mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
OrderChangeManager: Respect addons on cancellation check (Z#23193427) (#5132)
* OrderChangeManager: Respect addons on cancellation check (Z#23193427) * Update src/tests/base/test_orders.py Co-authored-by: luelista <weller@rami.io> --------- Co-authored-by: luelista <weller@rami.io>
This commit is contained in:
@@ -1759,11 +1759,19 @@ class OrderChangeManagerTests(TestCase):
|
||||
|
||||
@classscope(attr='o')
|
||||
def test_cancel_all_in_order(self):
|
||||
self.shirt.category = self.event.categories.create(name='Add-ons', is_addon=True)
|
||||
self.ticket.addons.create(addon_category=self.shirt.category)
|
||||
self.ocm.add_position(self.shirt, None, Decimal('13.00'), addon_to=self.op1)
|
||||
self.ocm.commit()
|
||||
self.order.refresh_from_db()
|
||||
self.ocm = OrderChangeManager(self.order, None)
|
||||
|
||||
assert self.order.positions.count() == 3
|
||||
self.ocm.cancel(self.op1)
|
||||
self.ocm.cancel(self.op2)
|
||||
with self.assertRaises(OrderError):
|
||||
self.ocm.commit()
|
||||
assert self.order.positions.count() == 2
|
||||
assert self.order.positions.count() == 3
|
||||
|
||||
@classscope(attr='o')
|
||||
def test_empty(self):
|
||||
|
||||
Reference in New Issue
Block a user