mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Allow quotas to "close" when once full (#1344)
* Model * Some UI * API and logging * Permission check * Add tests * Move option around
This commit is contained in:
@@ -338,6 +338,28 @@ class QuotaTest(ItemFormTest):
|
||||
with scopes_disabled():
|
||||
assert not Quota.objects.filter(id=c.id).exists()
|
||||
|
||||
def test_reopen(self):
|
||||
with scopes_disabled():
|
||||
c = Quota.objects.create(event=self.event1, name="Full house", size=500,
|
||||
close_when_sold_out=True, closed=True)
|
||||
self.post_doc('/control/event/%s/%s/quotas/%s/' % (self.orga1.slug, self.event1.slug, c.id),
|
||||
{'reopen': 'true'})
|
||||
with scopes_disabled():
|
||||
c.refresh_from_db()
|
||||
assert not c.closed
|
||||
assert c.close_when_sold_out
|
||||
|
||||
def test_reopen_and_disable(self):
|
||||
with scopes_disabled():
|
||||
c = Quota.objects.create(event=self.event1, name="Full house", size=500,
|
||||
close_when_sold_out=True, closed=True)
|
||||
self.post_doc('/control/event/%s/%s/quotas/%s/' % (self.orga1.slug, self.event1.slug, c.id),
|
||||
{'disable': 'true'})
|
||||
with scopes_disabled():
|
||||
c.refresh_from_db()
|
||||
assert not c.closed
|
||||
assert not c.close_when_sold_out
|
||||
|
||||
|
||||
class ItemsTest(ItemFormTest):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user