mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Order change form: Allow to add multiple identical positions (Z#23227479) (#6044)
* Order change form: Allow to add multiple identical positions (Z#23227479) * New implementation
This commit is contained in:
@@ -2406,6 +2406,15 @@ class OrderChangeManagerTests(TestCase):
|
||||
self.ocm.commit()
|
||||
assert self.order.positions.count() == 2
|
||||
|
||||
@classscope(attr='o')
|
||||
def test_add_item_quota_partial(self):
|
||||
q1 = self.event.quotas.create(name='Test', size=1)
|
||||
q1.items.add(self.shirt)
|
||||
self.ocm.add_position(self.shirt, None, None, None, count=2)
|
||||
with self.assertRaises(OrderError):
|
||||
self.ocm.commit()
|
||||
assert self.order.positions.count() == 2
|
||||
|
||||
@classscope(attr='o')
|
||||
def test_add_item_addon(self):
|
||||
self.shirt.category = self.event.categories.create(name='Add-ons', is_addon=True)
|
||||
|
||||
@@ -1584,10 +1584,11 @@ class OrderChangeTests(SoupTest):
|
||||
'add_position-MAX_NUM_FORMS': '100',
|
||||
'add_position-0-itemvar': str(self.shirt.pk),
|
||||
'add_position-0-do': 'on',
|
||||
'add_position-0-count': '2',
|
||||
'add_position-0-price': '14.00',
|
||||
})
|
||||
with scopes_disabled():
|
||||
assert self.order.positions.count() == 3
|
||||
assert self.order.positions.count() == 4
|
||||
assert self.order.positions.last().item == self.shirt
|
||||
assert self.order.positions.last().price == 14
|
||||
|
||||
|
||||
Reference in New Issue
Block a user