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
luxcem
memopol
Commits
168915a2
Commit
168915a2
authored
Oct 09, 2016
by
Nicolas Joyard
Browse files
Fix tests
parent
5553bbfe
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
src/memopol/tests/response_fixtures/RepresentativeListTest.test_cards.content
View file @
168915a2
This diff is collapsed.
Click to expand it.
src/memopol/tests/response_fixtures/ThemeListTest.test_cards.content
View file @
168915a2
<div class="col-xs-12 col-md-4 theme-card">
<div class="thumbnail">
<a class="custom-thumbnail custom-invisible" href="/themes/acta/">
<div class="row">
<div class="thumbnail">
<a class="custom-thumbnail custom-invisible" href="/themes/acta/">
<div class="row">
<div class="col-xs-12">
<h4 class="text-center">ACTA</h4>
<div class="col-xs-12">
<h4 class="text-center">ACTA</h4>
<p class="text-center lead">
<div class="description ellipsis"><div>Anti-Counterfeiting Trade Agreement</div></div>
<div class="info-container">
<div class="badge-container">
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="Dossiers">
<i class="fa fa-book" title=""></i>
<span class="badge">3</span>
</span>
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="Dossiers">
<i class="fa fa-book" title=""></i>
<span class="badge">3</span>
</span>
</p>
</div>
<div class="chart-container">
</div>
</div>
</a>
</div>
</div>
</a>
</div>
</div>
---
<div class="col-xs-12 col-md-4 theme-card">
<div class="thumbnail">
<a class="custom-thumbnail custom-invisible" href="/themes/etat-durgence/">
<div class="row">
<div class="col-xs-12">
<h4 class="text-center">Etat d'urgence</h4>
<div class="thumbnail">
<a class="custom-thumbnail custom-invisible" href="/themes/etat-durgence/">
<div class="row">
<
p
class="
text-center lead
">
<
div
class="
col-xs-12
">
<h4 class="text-center">Etat d'urgence</h4>
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="Links">
<i class="fa fa-link" title=""></i>
<span class="badge">2</span>
</span>
<div class="description ellipsis"><div>La réponse sécuritaire n'est pas la solution.</div></div>
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="Dossiers">
<i class="fa fa-book" title=""></i>
<span class="badge">4</span>
</span>
<div class="info-container">
<div class="badge-container">
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="Links">
<i class="fa fa-link" title=""></i>
<span class="badge">2</span>
</span>
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="
Proposal
s">
<i class="fa fa-
pencil
" title=""></i>
<span class="badge">
13
</span>
</span>
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="
Dossier
s">
<i class="fa fa-
book
" title=""></i>
<span class="badge">
4
</span>
</span>
<span class="label label-default" data-placement="bottom" data-toggle="tooltip" title="Proposals">
<i class="fa fa-pencil" title=""></i>
<span class="badge">13</span>
</span>
</p>
</div>
<div class="chart-container">
</div>
</div>
</a>
</div>
</div>
\ No newline at end of file
</div>
</a>
</div>
</div>
\ No newline at end of file
src/memopol/tests/test_home_navigation_pane.py
0 → 100644
View file @
168915a2
from
.base
import
BaseTest
class
NavigationPaneTest
(
BaseTest
):
url
=
'/'
def
test_queries
(
self
):
# First query to set session variables
self
.
client
.
get
(
self
.
url
)
"""
Today mep
- 1 for count reps with non null score
- 1 for random mep
- 1 for prefetch main mandate
Latest votes
- 1 for latest votes count setting
- 1 for latest votes (proposal)
- 1 for prefetching latest votes themes
- 1 for prefetching latest votes dossier themes
- 1 for prefetching latest votes dossier documents
- 1 for prefetching latest votes dossier documents chambers
Featured themes
- 1 for featured themes
"""
home_queries
=
10
with
self
.
assertNumQueries
(
self
.
left_pane_queries
+
home_queries
):
self
.
client
.
get
(
self
.
url
)
def
test_rep_search_chambers
(
self
):
self
.
selector_test
(
'#form-rep #chamber-rep option'
)
def
test_rep_search_countries
(
self
):
self
.
selector_test
(
'#form-rep #country option'
)
def
test_rep_search_parties
(
self
):
self
.
selector_test
(
'#form-rep #party option'
)
def
test_rep_search_committee
(
self
):
self
.
selector_test
(
'#form-rep #committee option'
)
def
test_rep_search_delegation
(
self
):
self
.
selector_test
(
'#form-rep #delegation option'
)
def
test_dossier_search_chambers
(
self
):
self
.
selector_test
(
'#form-dossier #chamber-dossier option'
)
src/memopol/views/home.py
View file @
168915a2
...
...
@@ -45,8 +45,7 @@ class HomeView(PositionFormMixin, RepresentativeViewMixin,
nb_links
=
Count
(
'links'
,
distinct
=
True
),
nb_dossiers
=
Count
(
'dossiers'
,
distinct
=
True
),
nb_proposals
=
Count
(
'proposals'
,
distinct
=
True
),
nb_positions
=
Count
(
'positions'
,
distinct
=
True
)
)
nb_positions
=
Count
(
'positions'
,
distinct
=
True
))
# Last votes
...
...
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