From 863e089c2b1a375d41fd82c0db0922429275649a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Wed, 27 Mar 2019 23:45:08 +0100 Subject: [PATCH] Fix tests. --- src/shop/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shop/tests.py b/src/shop/tests.py index 6646edef..7cf03842 100644 --- a/src/shop/tests.py +++ b/src/shop/tests.py @@ -23,14 +23,17 @@ class ProductAvailabilityTest(TestCase): product = ProductFactory(stock_amount=2) opr1 = OrderProductRelationFactory(product=product) + opr1.order.mark_as_paid() opr2 = OrderProductRelationFactory(product=product) + opr2.order.mark_as_paid() self.assertEqual(product.left_in_stock, 0) self.assertFalse(product.is_stock_available) self.assertFalse(product.is_available()) # Cancel one order - opr1.order.mark_as_cancelled() + opr1.order.cancelled = True + opr1.order.save() self.assertEqual(product.left_in_stock, 1) self.assertTrue(product.is_stock_available)