|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+# -*- coding: utf-8 -*-
|
|
1
|
2
|
from django.test import TestCase
|
|
2
|
3
|
|
|
3
|
4
|
from oscar.apps.basket.models import Basket
|
|
4
|
5
|
from oscar.apps.partner import strategy
|
|
5
|
6
|
from oscar.test.factories import (
|
|
6
|
|
- BasketFactory, BasketLineAttributeFactory, ProductFactory)
|
|
|
7
|
+ BasketFactory, BasketLineAttributeFactory, ProductFactory, OptionFactory)
|
|
7
|
8
|
|
|
8
|
9
|
|
|
9
|
10
|
class TestANewBasket(TestCase):
|
|
|
@@ -53,3 +54,13 @@ class TestBasketLine(TestCase):
|
|
53
|
54
|
BasketLineAttributeFactory(
|
|
54
|
55
|
line=line, value=u'\u2603', option__name='with')
|
|
55
|
56
|
self.assertEqual(line.description, u"A product (with = '\u2603')")
|
|
|
57
|
+
|
|
|
58
|
+ def test_create_line_reference(self):
|
|
|
59
|
+ basket = BasketFactory()
|
|
|
60
|
+ product = ProductFactory(title="A product")
|
|
|
61
|
+ option = OptionFactory(name="product_option", code="product_option")
|
|
|
62
|
+ option_product = ProductFactory(title=u'Asunción')
|
|
|
63
|
+ options = [{'option' : option, 'value': option_product}]
|
|
|
64
|
+ basket.add_product(product, options = options)
|
|
|
65
|
+
|
|
|
66
|
+
|