Actually test this - it returnet False because the form was unbound.

This commit is contained in:
Víðir Valberg Guðmundsson 2019-03-29 15:37:08 +01:00
parent d65624e95b
commit 95dcba3fc3

View file

@ -93,9 +93,9 @@ class TestOrderProductRelationForm(TestCase):
OrderProductRelationFactory(product=product, quantity=1, order__open=None)
# There should only be 1 product left, since we just reserved 1
opr2 = OrderProductRelationFactory(product=product, quantity=2)
opr2 = OrderProductRelationFactory(product=product)
form = OrderProductRelationForm(instance=opr2)
form = OrderProductRelationForm({'quantity': 2}, instance=opr2)
self.assertFalse(form.is_valid())
def test_clean_quantity_when_no_stock_amount(self):