Refs #85 -- Do not sell tickets that are marked as inactive

This commit is contained in:
Raphael Michel
2015-08-13 11:44:18 +02:00
parent 4277e689b8
commit 56961337ae
4 changed files with 15 additions and 3 deletions

View File

@@ -43,9 +43,16 @@ class ItemDisplayTest(EventTestMixin, BrowserTest):
super().setUp()
self.driver.implicitly_wait(10)
def test_not_active(self):
q = Quota.objects.create(event=self.event, name='Quota', size=2)
item = Item.objects.create(event=self.event, name='Early-bird ticket', default_price=0, active=False)
q.items.add(item)
self.driver.get('%s/%s/%s/' % (self.live_server_url, self.orga.slug, self.event.slug))
self.assertNotIn("Early-bird", self.driver.find_element_by_css_selector("body").text)
def test_without_category(self):
q = Quota.objects.create(event=self.event, name='Quota', size=2)
item = Item.objects.create(event=self.event, name='Early-bird ticket', default_price=0)
item = Item.objects.create(event=self.event, name='Early-bird ticket', default_price=0, active=True)
q.items.add(item)
self.driver.get('%s/%s/%s/' % (self.live_server_url, self.orga.slug, self.event.slug))
self.assertIn("Early-bird", self.driver.find_element_by_css_selector("section .product-row:first-child").text)