Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
949b7d0a
Commit
949b7d0a
authored
Aug 18, 2016
by
Nicolas Joyard
Browse files
Add tests for rep search
parent
ec7d8d4a
Changes
16
Hide whitespace changes
Inline
Side-by-side
memopol/tests/base.py
View file @
949b7d0a
...
...
@@ -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
)
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_chamber.content
0 → 100644
View file @
949b7d0a
<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
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_chamber.metadata
0 → 100644
View file @
949b7d0a
{
"status_code": 200
}
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_committee.content
0 → 100644
View file @
949b7d0a
<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
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_committee.metadata
0 → 100644
View file @
949b7d0a
{
"status_code": 200
}
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_country.content
0 → 100644
View file @
949b7d0a
<h4 class="text-center">Zigmantas BALČYTIS</h4>
---
<h4 class="text-center">Vilija BLINKEVIČIŪTĖ</h4>
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_country.metadata
0 → 100644
View file @
949b7d0a
{
"status_code": 200
}
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_delegation.content
0 → 100644
View file @
949b7d0a
<h4 class="text-center">Eva JOLY</h4>
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_delegation.metadata
0 → 100644
View file @
949b7d0a
{
"status_code": 200
}
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_name.content
0 → 100644
View file @
949b7d0a
<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
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_name.metadata
0 → 100644
View file @
949b7d0a
{
"status_code": 200
}
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_party.content
0 → 100644
View file @
949b7d0a
<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
memopol/tests/response_fixtures/RepresentativeListTest.test_search_by_party.metadata
0 → 100644
View file @
949b7d0a
{
"status_code": 200
}
\ No newline at end of file
memopol/tests/response_fixtures/RepresentativeListTest.test_search_no_results.content
0 → 100644
View file @
949b7d0a
memopol/tests/response_fixtures/RepresentativeListTest.test_search_no_results.metadata
0 → 100644
View file @
949b7d0a
{
"status_code": 200
}
\ No newline at end of file
memopol/tests/test_representative_list.py
View file @
949b7d0a
...
...
@@ -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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment