Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
memopol
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Porkepix
memopol
Commits
168915a2
Commit
168915a2
authored
Oct 09, 2016
by
Nicolas Joyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
5553bbfe
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
526 additions
and
474 deletions
+526
-474
src/memopol/tests/response_fixtures/RepresentativeListTest.test_cards.content
...sponse_fixtures/RepresentativeListTest.test_cards.content
+421
-421
src/memopol/tests/response_fixtures/ThemeListTest.test_cards.content
.../tests/response_fixtures/ThemeListTest.test_cards.content
+57
-51
src/memopol/tests/test_home_navigation_pane.py
src/memopol/tests/test_home_navigation_pane.py
+47
-0
src/memopol/views/home.py
src/memopol/views/home.py
+1
-2
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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