mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Fixed selectors in tests
This commit is contained in:
@@ -399,10 +399,10 @@ class ItemDisplayTest(EventTestMixin, SoupTest):
|
|||||||
q.items.add(item)
|
q.items.add(item)
|
||||||
doc = self.get_doc('/%s/%s/' % (self.orga.slug, self.event.slug))
|
doc = self.get_doc('/%s/%s/' % (self.orga.slug, self.event.slug))
|
||||||
self.assertIn("Early-bird", doc.select("section:nth-of-type(1) div:nth-of-type(1)")[0].text)
|
self.assertIn("Early-bird", doc.select("section:nth-of-type(1) div:nth-of-type(1)")[0].text)
|
||||||
self.assertIn("Red", doc.select("section:nth-of-type(1) div.variation")[0].text)
|
self.assertIn("Red", doc.select("section:nth-of-type(1) .variation")[0].text)
|
||||||
self.assertIn("14.00", doc.select("section:nth-of-type(1) div.variation")[0].text)
|
self.assertIn("14.00", doc.select("section:nth-of-type(1) .variation")[0].text)
|
||||||
self.assertIn("Black", doc.select("section:nth-of-type(1) div.variation")[1].text)
|
self.assertIn("Black", doc.select("section:nth-of-type(1) .variation")[1].text)
|
||||||
self.assertIn("12.00", doc.select("section:nth-of-type(1) div.variation")[1].text)
|
self.assertIn("12.00", doc.select("section:nth-of-type(1) .variation")[1].text)
|
||||||
|
|
||||||
def test_require_bundling(self):
|
def test_require_bundling(self):
|
||||||
with scopes_disabled():
|
with scopes_disabled():
|
||||||
@@ -430,8 +430,12 @@ class ItemDisplayTest(EventTestMixin, SoupTest):
|
|||||||
self.event.settings.hide_sold_out = True
|
self.event.settings.hide_sold_out = True
|
||||||
|
|
||||||
doc = self.get_doc('/%s/%s/' % (self.orga.slug, self.event.slug))
|
doc = self.get_doc('/%s/%s/' % (self.orga.slug, self.event.slug))
|
||||||
self.assertNotIn("Early-bird", doc.select("section:nth-of-type(1) div:nth-of-type(1)")[0].text)
|
html_element = doc.select("article:nth-of-type(1) div:nth-of-type(1)")
|
||||||
self.assertNotIn("SOLD OUT", doc.select("section:nth-of-type(1)")[0].text)
|
if (html_element):
|
||||||
|
self.assertNotIn("Early-bird", html_element[0].text)
|
||||||
|
html_element = doc.select("article:nth-of-type(1)")
|
||||||
|
if (html_element):
|
||||||
|
self.assertNotIn("SOLD OUT", html_element[0].text)
|
||||||
|
|
||||||
def test_hidden_if_available(self):
|
def test_hidden_if_available(self):
|
||||||
with scopes_disabled():
|
with scopes_disabled():
|
||||||
|
|||||||
Reference in New Issue
Block a user