Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Use latest onegov.ballot
Browse files Browse the repository at this point in the history
  • Loading branch information
msom committed Mar 26, 2018
1 parent 67db098 commit 3bb8217
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion onegov/election_day/layouts/election.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def visible(self, tab=None):
return (
self.proporz and
not self.tacit and
self.model.has_panachage_data
self.model.has_lists_panachage_data
)

return True
Expand Down
26 changes: 15 additions & 11 deletions onegov/election_day/tests/views/test_views_election.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,25 @@ def test_view_election_party_strengths(election_day_app_gr):

export = client.get('/election/proporz-election/data-parties').text
assert export == (
"year,name,id,total_votes,color,mandates,votes\r\n"
"2015,BDP,0,11270,#0571b0,1,60387\r\n"
"2015,CVP,1,11270,#0571b0,1,49117\r\n"
"2015,FDP,2,11270,#0571b0,0,35134\r\n"
'year,name,id,total_votes,color,mandates,votes,'
'panachage_votes_from_0,panachage_votes_from_1,panachage_votes_from_2'
'\r\n'
'2015,BDP,0,11270,#0571b0,1,60387,,,\r\n'
'2015,CVP,1,11270,#0571b0,1,49117,,,\r\n'
'2015,FDP,2,11270,#0571b0,0,35134,,,\r\n'
)

# Historical data
csv_parties = (
"year,name,id,total_votes,color,mandates,votes\r\n"
"2015,BDP,0,60000,#efb52c,1,10000\r\n"
"2015,CVP,1,60000,#ff6300,1,30000\r\n"
"2015,FDP,2,60000,#4068c8,0,20000\r\n"
"2011,BDP,0,40000,#efb52c,1,1000\r\n"
"2011,CVP,1,40000,#ff6300,1,15000\r\n"
"2011,FDP,2,40000,#4068c8,1,10000\r\n"
'year,name,id,total_votes,color,mandates,votes,'
'panachage_votes_from_0,panachage_votes_from_1,panachage_votes_from_2'
'\r\n'
'2015,BDP,0,60000,#efb52c,1,10000,,,\r\n'
'2015,CVP,1,60000,#ff6300,1,30000,,,\r\n'
'2015,FDP,2,60000,#4068c8,0,20000,,,\r\n'
'2011,BDP,0,40000,#efb52c,1,1000,,,\r\n'
'2011,CVP,1,40000,#ff6300,1,15000,,,\r\n'
'2011,FDP,2,40000,#4068c8,1,10000,,,\r\n'
).encode('utf-8')

upload = client.get('/election/proporz-election/upload-party-results')
Expand Down
2 changes: 1 addition & 1 deletion onegov/election_day/views/election/lists_panachage.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def view_election_lists_panachage_data(self, request):
if self.type == 'majorz':
return {}

if not self.has_panachage_data:
if not self.has_lists_panachage_data:
return {}

blank = request.translate(_("Blank list")) if request else '-'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_long_description():
'cached_property',
'cssmin',
'onegov.core>=0.64',
'onegov.ballot>=3.3.1',
'onegov.ballot>=3.4.0',
'onegov.form>=0.12.0',
'onegov.foundation>=0.0.4',
'onegov.pdf>=0.2.0',
Expand Down

0 comments on commit 3bb8217

Please sign in to comment.