@@ -71,18 +71,18 @@ class RegistrationCartTestCase(SetTimeMixin, TestCase):
cls.PROD_4.price = Decimal("5.00")
cls.PROD_4.save()
# Burn through some carts -- this made some past EC tests fail
current_cart = TestingCartController.for_user(cls.USER_1)
current_cart.cart.active = False
current_cart.cart.save()
current_cart.next_cart()
current_cart = TestingCartController.for_user(cls.USER_2)
@classmethod
def make_ceiling(cls, name, limit=None, start_time=None, end_time=None):
limit_ceiling = rego.TimeOrStockLimitEnablingCondition.objects.create(
description=name,
mandatory=True,
@@ -139,14 +139,14 @@ class RegistrationCartTestCase(SetTimeMixin, TestCase):
class BasicCartTests(RegistrationCartTestCase):
def test_get_cart(self):
current_cart = TestingCartController.for_user(self.USER_1)
old_cart = current_cart
self.assertNotEqual(old_cart.cart, current_cart.cart)
@@ -211,14 +211,14 @@ class BasicCartTests(RegistrationCartTestCase):
# User should not be able to add 10 of PROD_1 to the current cart now,
# because they have a limit of 10.
with self.assertRaises(ValidationError):
current_cart.add_to_cart(self.PROD_1, 10)
# even though it's a new cart.
@@ -269,14 +269,14 @@ class BasicCartTests(RegistrationCartTestCase):
current_cart.set_quantity(self.PROD_3, 5)
current_cart.set_quantity(self.PROD_4, 5)
# Cannot add to cart if category limit is filled by two products
current_cart.add_to_cart(self.PROD_3, 1)
# The category limit should extend across carts
current_cart.add_to_cart(self.PROD_3, 10)
@@ -295,14 +295,14 @@ class BasicCartTests(RegistrationCartTestCase):
current_cart.set_quantity(self.PROD_3, 0)
# There's only 6 allowed of PROD_4
current_cart.add_to_cart(self.PROD_4, 1)
# The limits should extend across carts...
current_cart.set_quantity(self.PROD_3, 4)
@@ -322,14 +322,14 @@ class BasicCartTests(RegistrationCartTestCase):
prods = get_prods()
self.assertTrue(item in prods)
current_cart.add_to_cart(item, quantity)
self.assertTrue(item not in prods)