OrderChangeManager: Prevent creation of 0 € invoices

This commit is contained in:
Raphael Michel
2020-03-06 17:05:15 +01:00
parent 939335f94b
commit 4f6712ccbe
2 changed files with 11 additions and 1 deletions

View File

@@ -1393,6 +1393,15 @@ class OrderChangeManagerTests(TestCase):
self.ocm.commit()
assert self.order.invoices.count() == 3
@classscope(attr='o')
def test_no_new_invoice_for_free_order(self):
generate_invoice(self.order)
assert self.order.invoices.count() == 1
self.ocm.change_price(self.op1, Decimal('0.00'))
self.ocm.change_price(self.op2, Decimal('0.00'))
self.ocm.commit()
assert self.order.invoices.count() == 2
@classscope(attr='o')
def test_reissue_invoice_disabled(self):
self.ocm.reissue_invoice = False