Commit 949b7d0a authored by Nicolas Joyard's avatar Nicolas Joyard

Add tests for rep search

parent ec7d8d4a
......@@ -15,5 +15,6 @@ class BaseTest(ResponseDiffTestMixin, test.TestCase):
"""
left_pane_queries = 5
def selector_test(self, selector):
self.assertResponseDiffEmpty(self.client.get(self.url), selector)
def selector_test(self, selector, url=None):
self.assertResponseDiffEmpty(self.client.get(url or self.url),
selector)
<h4 class="text-center">Zigmantas BALČYTIS</h4>
---
<h4 class="text-center">Vilija BLINKEVIČIŪTĖ</h4>
---
<h4 class="text-center">Elmar BROK</h4>
---
<h4 class="text-center">Cristian-Silviu BUŞOI</h4>
---
<h4 class="text-center">David CASA</h4>
---
<h4 class="text-center">Jean-Marie CAVADA</h4>
---
<h4 class="text-center">Nikolaos CHOUNTIS</h4>
---
<h4 class="text-center">Michael CRAMER</h4>
---
<h4 class="text-center">Viorica DĂNCILĂ</h4>
---
<h4 class="text-center">Michel DANTIN</h4>
---
<h4 class="text-center">Tamás DEUTSCH</h4>
---
<h4 class="text-center">Bas EICKHOUT</h4>
\ No newline at end of file
<h4 class="text-center">Vilija BLINKEVIČIŪTĖ</h4>
---
<h4 class="text-center">Monika FLAŠÍKOVÁ BEŇOVÁ</h4>
---
<h4 class="text-center">Kinga GÁL</h4>
---
<h4 class="text-center">Iliana IOTOVA</h4>
---
<h4 class="text-center">Eva JOLY</h4>
---
<h4 class="text-center">Jarosław KALINOWSKI</h4>
---
<h4 class="text-center">Birgit SIPPEL</h4>
---
<h4 class="text-center">Cecilia WIKSTRÖM</h4>
\ No newline at end of file
<h4 class="text-center">Zigmantas BALČYTIS</h4>
---
<h4 class="text-center">Vilija BLINKEVIČIŪTĖ</h4>
\ No newline at end of file
<h4 class="text-center">Eva JOLY</h4>
\ No newline at end of file
<h4 class="text-center">Zigmantas BALČYTIS</h4>
---
<h4 class="text-center">Elmar BROK</h4>
---
<h4 class="text-center">Jean-Marie CAVADA</h4>
---
<h4 class="text-center">Tamás DEUTSCH</h4>
---
<h4 class="text-center">Ismail ERTUG</h4>
---
<h4 class="text-center">José Manuel FERNANDES</h4>
---
<h4 class="text-center">Marian HARKIN</h4>
---
<h4 class="text-center">Mary HONEYBALL</h4>
\ No newline at end of file
<h4 class="text-center">Zigmantas BALČYTIS</h4>
---
<h4 class="text-center">Vilija BLINKEVIČIŪTĖ</h4>
---
<h4 class="text-center">Viorica DĂNCILĂ</h4>
---
<h4 class="text-center">Ismail ERTUG</h4>
---
<h4 class="text-center">Monika FLAŠÍKOVÁ BEŇOVÁ</h4>
---
<h4 class="text-center">Eider GARDIAZABAL RUBIAL</h4>
---
<h4 class="text-center">Mary HONEYBALL</h4>
---
<h4 class="text-center">Iliana IOTOVA</h4>
---
<h4 class="text-center">Liisa JAAKONSAARI</h4>
---
<h4 class="text-center">Olle LUDVIGSSON</h4>
---
<h4 class="text-center">Birgit SIPPEL</h4>
\ No newline at end of file
......@@ -20,3 +20,31 @@ class RepresentativeListTest(BaseTest):
def test_cards(self):
self.selector_test('.representative-card')
def test_search_no_results(self):
self.selector_test('.representative-card h4',
'%s?search=non-existing' % self.url)
def test_search_by_name(self):
self.selector_test('.representative-card h4',
'%s?search=ma' % self.url)
def test_search_by_chamber(self):
self.selector_test('.representative-card h4',
'%s?chamber=1' % self.url)
def test_search_by_country(self):
self.selector_test('.representative-card h4',
'%s?country=145' % self.url)
def test_search_by_party(self):
self.selector_test('.representative-card h4',
'%s?party=21' % self.url)
def test_search_by_committee(self):
self.selector_test('.representative-card h4',
'%s?committee=7' % self.url)
def test_search_by_delegation(self):
self.selector_test('.representative-card h4',
'%s?delegation=95' % self.url)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment