fedora_elections/__init__.py | 2 -
fedora_elections/elections.py | 45 ++++++++++++++------------
fedora_elections/models.py | 2 -
fedora_elections/templates/index.html | 4 ++
files/fedora-elections.spec | 7 +++-
tests/__init__.py | 3 +
tests/test_flask_range_voting.py | 58 +++++++++++++++++++++++++++++-----
7 files changed, 88 insertions(+), 33 deletions(-)
New commits:
commit 728c8852a4f107add514b81abc7ceb8ec0e1e9b2
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Mon Aug 10 18:08:48 2015 -0700
Remove extra whitespace
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 5cfe52b..1e6706c 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -154,12 +154,12 @@ def vote_range(election, revote):
SESSION.add(vote)
else:
new_vote = models.Vote(
- election_id=election.id,
- voter=flask.g.fas_user.username,
- timestamp=datetime.now(),
- candidate_id=candidate.short_name,
- value=candidate.data,
- )
+ election_id=election.id,
+ voter=flask.g.fas_user.username,
+ timestamp=datetime.now(),
+ candidate_id=candidate.short_name,
+ value=candidate.data,
+ )
SESSION.add(new_vote)
SESSION.commit()
commit b250393dd0810dd0321c14ce59fabab12d9a9490
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Mon Aug 10 17:29:46 2015 -0700
Indentation fix
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index ac8c320..5cfe52b 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -154,12 +154,12 @@ def vote_range(election, revote):
SESSION.add(vote)
else:
new_vote = models.Vote(
- election_id=election.id,
- voter=flask.g.fas_user.username,
- timestamp=datetime.now(),
- candidate_id=candidate.short_name,
- value=candidate.data,
- )
+ election_id=election.id,
+ voter=flask.g.fas_user.username,
+ timestamp=datetime.now(),
+ candidate_id=candidate.short_name,
+ value=candidate.data,
+ )
SESSION.add(new_vote)
SESSION.commit()
commit 795df2a6d83e8697f59a8a36101e8ef5d06eada1
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Mon Aug 10 13:33:34 2015 -0700
We have only implememnted range revote, add condition
diff --git a/fedora_elections/templates/index.html
b/fedora_elections/templates/index.html
index 5d15ef8..2add908 100644
--- a/fedora_elections/templates/index.html
+++ b/fedora_elections/templates/index.html
@@ -32,7 +32,7 @@
<a href="{{ url_for('vote', election_alias=election.alias)
}}">
Vote now!
</a>
- {% else %}
+ {% elif election.voting_type == 'range' %}
<a href="{{ url_for('vote', election_alias=election.alias)
}}">
Change your vote!
</a>
commit d4db639baae8356719560aa9adbcc43ece2800f5
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Mon Aug 10 13:28:40 2015 -0700
use list comprehension instead of lambda
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 51e20f1..ac8c320 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -141,12 +141,13 @@ def vote_range(election, revote):
if form.validate_on_submit():
if form.action.data == 'submit':
- candidate_filter = lambda item: item.short_name not in ['csrf_token',
'action']
- candidates = filter(lambda candidate: candidate_filter(candidate), form)
- sorted_form = sorted(candidates, key=lambda candidate: candidate.short_name)
- iter = 0
- for index in range(len(sorted_form)):
- candidate = sorted_form[index]
+ candidates = [
+ candidate
+ for candidate in form
+ if candidate and candidate.short_name not in
['csrf_token', 'action']
+ ]
+ for index in range(len(candidates)):
+ candidate = candidates[index]
if revote:
vote = votes[index]
vote.value = candidate.data
commit 981ae199fb7b9742661a19e07b7d3e5800336f83
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Mon Aug 10 13:25:14 2015 -0700
no need to sort by cand_id, already done :D
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index fe0945b..51e20f1 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -126,8 +126,6 @@ def vote_range(election, revote):
votes = models.Vote.of_user_on_election(
SESSION, flask.g.fas_user.username, election.id)
- sorted_votes = sorted(votes, key=lambda candidate: candidate.candidate_id)
-
num_candidates = election.candidates.count()
cand_ids = [str(cand.id) for cand in election.candidates]
@@ -150,7 +148,7 @@ def vote_range(election, revote):
for index in range(len(sorted_form)):
candidate = sorted_form[index]
if revote:
- vote = sorted_votes[index]
+ vote = votes[index]
vote.value = candidate.data
SESSION.add(vote)
else:
commit 7d5e55a3c96c11cb1add431f7940b7c1781cdd64
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Aug 5 08:45:27 2015 -0700
Fix tests to use Vote class method for revote tests
diff --git a/tests/test_flask_range_voting.py b/tests/test_flask_range_voting.py
index a6f1eaa..c18aca9 100644
--- a/tests/test_flask_range_voting.py
+++ b/tests/test_flask_range_voting.py
@@ -307,11 +307,10 @@ class FlaskRangeElectionstests(ModelFlasktests):
}
self.app.post('/vote/test_election3', data=data,
follow_redirects=True)
vote = fedora_elections.models.Vote
- votes = self.session.query(vote).filter(vote.voter == 'nerdsville')
- sorted_votes = sorted(votes, key=lambda vote: vote.candidate_id)
- self.assertEqual(sorted_votes[0].value, 1)
- self.assertEqual(sorted_votes[1].value, 0)
- self.assertEqual(sorted_votes[2].value, 2)
+ votes = vote.of_user_on_election(self.session, "nerdsville",
'3')
+ self.assertEqual(votes[0].value, 1)
+ self.assertEqual(votes[1].value, 0)
+ self.assertEqual(votes[2].value, 2)
#Let's not do repetition of what is tested above we aren't testing the
#functionality of voting as that has already been asserted
@@ -332,11 +331,11 @@ class FlaskRangeElectionstests(ModelFlasktests):
self.assertTrue('<h3>Current elections</h3>' in
output.data)
self.assertTrue('<h3>Next 1 elections</h3>' in
output.data)
self.assertTrue('<h3>Last 2 elections</h3>' in
output.data)
- votes = self.session.query(vote).filter(vote.voter == 'nerdsville')
- sorted_votes = sorted(votes, key=lambda vote: vote.candidate_id)
- self.assertEqual(sorted_votes[0].value, 2)
- self.assertEqual(sorted_votes[1].value, 1)
- self.assertEqual(sorted_votes[2].value, 1)
+ vote = fedora_elections.models.Vote
+ votes = vote.of_user_on_election(self.session, "nerdsville",
'3')
+ self.assertEqual(votes[0].value, 2)
+ self.assertEqual(votes[1].value, 1)
+ self.assertEqual(votes[2].value, 1)
#If we haven't failed yet, HOORAY!
commit d8690fa12ef146c5d193b66dc95ce105dbc306c2
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Aug 5 08:40:26 2015 -0700
remove unused dependency
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 2a067ff..fe0945b 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -38,7 +38,6 @@ from fedora_elections import (
is_safe_url, safe_redirect_back,
)
from fedora_elections.utils import build_name_map
-from sqlalchemy import update
def login_required(f):
@wraps(f)
commit 061c5aecb945d0dd84bfc064a694e3db23ac192b
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Aug 5 08:39:16 2015 -0700
sort by candidate_id in Vote class method of_user_on_election
diff --git a/fedora_elections/models.py b/fedora_elections/models.py
index dff7cc4..b3e72cc 100644
--- a/fedora_elections/models.py
+++ b/fedora_elections/models.py
@@ -356,7 +356,7 @@ class Vote(BASE):
).filter(
cls.voter == user
).order_by(
- cls.timestamp
+ cls.candidate_id
)
if count:
commit 1b938fd60199c355866a9a68b97e5793bc3dc23a
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Aug 5 08:38:43 2015 -0700
Use for idx in range for loop
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index d7e512b..2a067ff 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -148,14 +148,12 @@ def vote_range(election, revote):
candidates = filter(lambda candidate: candidate_filter(candidate), form)
sorted_form = sorted(candidates, key=lambda candidate: candidate.short_name)
iter = 0
- for candidate in sorted_form:
-
+ for index in range(len(sorted_form)):
+ candidate = sorted_form[index]
if revote:
- vote = sorted_votes[iter]
+ vote = sorted_votes[index]
vote.value = candidate.data
SESSION.add(vote)
- iter += 1
-
else:
new_vote = models.Vote(
election_id=election.id,
commit ee55ebd7e1730610d68147ee80588f9400ead879
Author: Joshua Santos <nerdsville(a)fed.dev>
Date: Fri Jul 17 14:51:39 2015 -0400
Add revote link
diff --git a/fedora_elections/templates/index.html
b/fedora_elections/templates/index.html
index 64b526b..5d15ef8 100644
--- a/fedora_elections/templates/index.html
+++ b/fedora_elections/templates/index.html
@@ -32,6 +32,10 @@
<a href="{{ url_for('vote', election_alias=election.alias)
}}">
Vote now!
</a>
+ {% else %}
+ <a href="{{ url_for('vote', election_alias=election.alias)
}}">
+ Change your vote!
+ </a>
{% endif %}
{% endif %}
</td>
commit a29d040c98f28e588b80cb4173c150bacd625144
Author: Joshua Santos <nerdsville(a)fed.dev>
Date: Fri Jul 17 14:42:57 2015 -0400
remove nose requirement
diff --git a/requirements.txt b/requirements.txt
index 4352ff8..4810410 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,4 +11,3 @@ SQLAlchemy
wtforms
dogpile.cache
blinker # required by Flask for the unit-tests (for signaling)
-nose===1.3.0
commit 0b43cb068fcd0a7d73cf1e7d740fda4eff639f1f
Author: Joshua Santos <nerdsville(a)fed.dev>
Date: Fri Jul 17 14:41:02 2015 -0400
move comment to two lines
diff --git a/tests/test_flask_range_voting.py b/tests/test_flask_range_voting.py
index e3d72eb..a6f1eaa 100644
--- a/tests/test_flask_range_voting.py
+++ b/tests/test_flask_range_voting.py
@@ -312,7 +312,9 @@ class FlaskRangeElectionstests(ModelFlasktests):
self.assertEqual(sorted_votes[0].value, 1)
self.assertEqual(sorted_votes[1].value, 0)
self.assertEqual(sorted_votes[2].value, 2)
- #Let's not do repetition of what is tested above we aren't testing the
functionality of voting as that has already been asserted
+ #Let's not do repetition of what is tested above we aren't testing the
+ #functionality of voting as that has already been asserted
+
#Next, we need to try revoting
newdata = {
'4': 2,
commit 3a4af527cd53edba4f122822ce1c2cd9626c50f4
Author: Joshua Santos <nerdsville(a)fed.dev>
Date: Fri Jul 17 14:27:13 2015 -0400
Update revote to use ORM
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 55c1b8d..d7e512b 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -125,7 +125,9 @@ def vote(election_alias):
def vote_range(election, revote):
votes = models.Vote.of_user_on_election(
- SESSION, flask.g.fas_user.username, election.id, count=True)
+ SESSION, flask.g.fas_user.username, election.id)
+
+ sorted_votes = sorted(votes, key=lambda candidate: candidate.candidate_id)
num_candidates = election.candidates.count()
@@ -142,27 +144,27 @@ def vote_range(election, revote):
if form.validate_on_submit():
if form.action.data == 'submit':
- for candidate in form:
- if candidate.short_name in ['csrf_token', 'action']:
- continue
+ candidate_filter = lambda item: item.short_name not in ['csrf_token',
'action']
+ candidates = filter(lambda candidate: candidate_filter(candidate), form)
+ sorted_form = sorted(candidates, key=lambda candidate: candidate.short_name)
+ iter = 0
+ for candidate in sorted_form:
+
if revote:
- vote = update(models.Vote).\
- where(models.Vote.candidate_id == candidate.short_name
- and models.Vote.voter == flask.g.fas_user.username
- and models.Vote.election == election.id).\
- values(value = candidate.data)
- SESSION.execute(vote)
- #break out of candidate loop
- continue
+ vote = sorted_votes[iter]
+ vote.value = candidate.data
+ SESSION.add(vote)
+ iter += 1
- new_vote = models.Vote(
+ else:
+ new_vote = models.Vote(
election_id=election.id,
voter=flask.g.fas_user.username,
timestamp=datetime.now(),
candidate_id=candidate.short_name,
value=candidate.data,
- )
- SESSION.add(new_vote)
+ )
+ SESSION.add(new_vote)
SESSION.commit()
flask.flash("Your vote has been recorded. Thank you!")
diff --git a/tests/test_flask_range_voting.py b/tests/test_flask_range_voting.py
index 2c7f792..e3d72eb 100644
--- a/tests/test_flask_range_voting.py
+++ b/tests/test_flask_range_voting.py
@@ -293,7 +293,7 @@ class FlaskRangeElectionstests(ModelFlasktests):
#First we need to vote
self.setup_db()
- user = FakeUser(['voters'], username='pingou')
+ user = FakeUser(['voters'], username='nerdsville')
with user_set(fedora_elections.APP, user):
retrieve_csrf = self.app.post('/vote/test_election3')
csrf_token = retrieve_csrf.data.split(
@@ -306,6 +306,12 @@ class FlaskRangeElectionstests(ModelFlasktests):
'csrf_token': csrf_token,
}
self.app.post('/vote/test_election3', data=data,
follow_redirects=True)
+ vote = fedora_elections.models.Vote
+ votes = self.session.query(vote).filter(vote.voter == 'nerdsville')
+ sorted_votes = sorted(votes, key=lambda vote: vote.candidate_id)
+ self.assertEqual(sorted_votes[0].value, 1)
+ self.assertEqual(sorted_votes[1].value, 0)
+ self.assertEqual(sorted_votes[2].value, 2)
#Let's not do repetition of what is tested above we aren't testing the
functionality of voting as that has already been asserted
#Next, we need to try revoting
newdata = {
@@ -324,6 +330,11 @@ class FlaskRangeElectionstests(ModelFlasktests):
self.assertTrue('<h3>Current elections</h3>' in
output.data)
self.assertTrue('<h3>Next 1 elections</h3>' in
output.data)
self.assertTrue('<h3>Last 2 elections</h3>' in
output.data)
+ votes = self.session.query(vote).filter(vote.voter == 'nerdsville')
+ sorted_votes = sorted(votes, key=lambda vote: vote.candidate_id)
+ self.assertEqual(sorted_votes[0].value, 2)
+ self.assertEqual(sorted_votes[1].value, 1)
+ self.assertEqual(sorted_votes[2].value, 1)
#If we haven't failed yet, HOORAY!
commit e7ccc3bb8b19a934d420da1478c01326cb755d47
Author: Joshua Santos <nerdsville(a)fed.dev>
Date: Fri Jul 17 10:17:22 2015 -0400
Need to filter candidates before even checking if it is revote
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index dffa9ec..55c1b8d 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -143,6 +143,8 @@ def vote_range(election, revote):
if form.validate_on_submit():
if form.action.data == 'submit':
for candidate in form:
+ if candidate.short_name in ['csrf_token', 'action']:
+ continue
if revote:
vote = update(models.Vote).\
where(models.Vote.candidate_id == candidate.short_name
@@ -152,8 +154,6 @@ def vote_range(election, revote):
SESSION.execute(vote)
#break out of candidate loop
continue
- if candidate.short_name in ['csrf_token', 'action']:
- continue
new_vote = models.Vote(
election_id=election.id,
commit 63f3ce19879b44be7d3998b63fde86e81a37dd38
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Jul 15 04:23:09 2015 -0700
Apparently the last voter is not a dictator :P
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 753e45b..dffa9ec 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -145,7 +145,9 @@ def vote_range(election, revote):
for candidate in form:
if revote:
vote = update(models.Vote).\
- where(models.Vote.candidate_id == candidate.short_name and
models.Vote.voter == flask.g.fas_user.username).\
+ where(models.Vote.candidate_id == candidate.short_name
+ and models.Vote.voter == flask.g.fas_user.username
+ and models.Vote.election == election.id).\
values(value = candidate.data)
SESSION.execute(vote)
#break out of candidate loop
commit 32a2cea381423192ab9afe6a8cbb728baa159afa
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Jul 15 04:20:55 2015 -0700
Apparently the last voter is not a dictator :P
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 07ddb02..753e45b 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -142,12 +142,10 @@ def vote_range(election, revote):
if form.validate_on_submit():
if form.action.data == 'submit':
- if revote:
- old_votes = models.Vote.of_user_on_election(SESSION,
flask.g.fas_user.username, election.id)
for candidate in form:
if revote:
vote = update(models.Vote).\
- where(models.Vote.candidate_id == candidate.short_name).\
+ where(models.Vote.candidate_id == candidate.short_name and
models.Vote.voter == flask.g.fas_user.username).\
values(value = candidate.data)
SESSION.execute(vote)
#break out of candidate loop
commit afdde721c525702ba0630511f26bf16c20843df1
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Jul 15 04:13:21 2015 -0700
Use update instead of nested for
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index a8efb2a..07ddb02 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -38,7 +38,7 @@ from fedora_elections import (
is_safe_url, safe_redirect_back,
)
from fedora_elections.utils import build_name_map
-
+from sqlalchemy import update
def login_required(f):
@wraps(f)
@@ -146,13 +146,10 @@ def vote_range(election, revote):
old_votes = models.Vote.of_user_on_election(SESSION,
flask.g.fas_user.username, election.id)
for candidate in form:
if revote:
- #TODO: this could probably be done in a more efficient manner
- for vote in old_votes:
- if vote.candidate_id == candidate.short_name:
- vote.value = candidate.data
- SESSION.commit()
- #break out of this loop
- continue
+ vote = update(models.Vote).\
+ where(models.Vote.candidate_id == candidate.short_name).\
+ values(value = candidate.data)
+ SESSION.execute(vote)
#break out of candidate loop
continue
if candidate.short_name in ['csrf_token', 'action']:
commit a14f385221e59ad9c811bb3fa5541db3faa83e80
Author: Joshua Santos <nerdsville(a)nerdsville.net>
Date: Wed Jul 15 03:21:59 2015 -0700
Add range revoting
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index d46db72..a8efb2a 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -108,12 +108,10 @@ def vote(election_alias):
votes = models.Vote.of_user_on_election(
SESSION, flask.g.fas_user.username, election.id, count=True)
- if votes > 0:
- flask.flash('You have already voted in the election!')
- return safe_redirect_back()
+ revote = True if votes > 0 else False
if election.voting_type.startswith('range'):
- return vote_range(election)
+ return vote_range(election, revote)
elif election.voting_type == 'simple':
return vote_simple(election)
elif election.voting_type == 'select':
@@ -125,8 +123,7 @@ def vote(election_alias):
'Unknown election voting type: %s' % election.voting_type)
return safe_redirect_back()
-
-def vote_range(election):
+def vote_range(election, revote):
votes = models.Vote.of_user_on_election(
SESSION, flask.g.fas_user.username, election.id, count=True)
@@ -144,9 +141,20 @@ def vote_range(election):
max_range=max_selection)
if form.validate_on_submit():
-
if form.action.data == 'submit':
+ if revote:
+ old_votes = models.Vote.of_user_on_election(SESSION,
flask.g.fas_user.username, election.id)
for candidate in form:
+ if revote:
+ #TODO: this could probably be done in a more efficient manner
+ for vote in old_votes:
+ if vote.candidate_id == candidate.short_name:
+ vote.value = candidate.data
+ SESSION.commit()
+ #break out of this loop
+ continue
+ #break out of candidate loop
+ continue
if candidate.short_name in ['csrf_token', 'action']:
continue
diff --git a/requirements.txt b/requirements.txt
index 4810410..4352ff8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,3 +11,4 @@ SQLAlchemy
wtforms
dogpile.cache
blinker # required by Flask for the unit-tests (for signaling)
+nose===1.3.0
diff --git a/tests/test_flask_range_voting.py b/tests/test_flask_range_voting.py
index d0be838..2c7f792 100644
--- a/tests/test_flask_range_voting.py
+++ b/tests/test_flask_range_voting.py
@@ -55,14 +55,6 @@ class FlaskRangeElectionstests(ModelFlasktests):
self.setup_db()
- user = FakeUser(['voters'], username='toshio')
- with user_set(fedora_elections.APP, user):
- output = self.app.get(
- '/vote/test_election3', follow_redirects=True)
- self.assertTrue(
- 'class="message">You have already voted in the
election!</'
- in output.data)
-
user = FakeUser(['voters'], username='pingou')
with user_set(fedora_elections.APP, user):
output = self.app.get(
@@ -296,6 +288,44 @@ class FlaskRangeElectionstests(ModelFlasktests):
self.assertTrue('<h3>Next 1 elections</h3>' in
output.data)
self.assertTrue('<h3>Last 2 elections</h3>' in
output.data)
+ def test_vote_range_revote(self):
+ """ Test the vote_range function - the re-voting part.
"""
+ #First we need to vote
+ self.setup_db()
+
+ user = FakeUser(['voters'], username='pingou')
+ with user_set(fedora_elections.APP, user):
+ retrieve_csrf = self.app.post('/vote/test_election3')
+ csrf_token = retrieve_csrf.data.split(
+ 'name="csrf_token" type="hidden"
value="')[1].split('">')[0]
+ data = {
+ '4': 1,
+ '5': 0,
+ '6': 2,
+ 'action': 'submit',
+ 'csrf_token': csrf_token,
+ }
+ self.app.post('/vote/test_election3', data=data,
follow_redirects=True)
+ #Let's not do repetition of what is tested above we aren't testing the
functionality of voting as that has already been asserted
+ #Next, we need to try revoting
+ newdata = {
+ '4': 2,
+ '5': 1,
+ '6': 1,
+ 'action': 'submit',
+ 'csrf_token': csrf_token,
+ }
+ output = self.app.post('/vote/test_election3', data=newdata,
follow_redirects=True)
+ #Next, we need to check if the vote has been recorded
+ self.assertEqual(output.status_code, 200)
+ self.assertTrue(
+ 'class="message">Your vote has been recorded. Thank
you!</'
+ in output.data)
+ self.assertTrue('<h3>Current elections</h3>' in
output.data)
+ self.assertTrue('<h3>Next 1 elections</h3>' in
output.data)
+ self.assertTrue('<h3>Last 2 elections</h3>' in
output.data)
+ #If we haven't failed yet, HOORAY!
+
if __name__ == '__main__':
SUITE = unittest.TestLoader().loadTestsFromTestCase(
commit f778ec9c556419915952e5db6fa21aa3c047b1ce
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Aug 4 15:30:48 2015 +0200
Adjust the faitout url to the new address
diff --git a/tests/__init__.py b/tests/__init__.py
index 08c6833..eecfc4a 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -49,7 +49,8 @@ from fedora_elections import models
DB_PATH = 'sqlite:///:memory:'
-FAITOUT_URL = 'http://209.132.184.152/faitout/'
+FAITOUT_URL = 'http://faitout.fedorainfracloud.org/'
+
if os.environ.get('BUILD_ID'):
try:
import requests
commit 7f01a48e58fc2bd9ed4d92217e016f0711e9df7e
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 28 11:27:16 2015 +0200
Release 2.5.4
diff --git a/fedora_elections/__init__.py b/fedora_elections/__init__.py
index 4e6273c..c08a61c 100644
--- a/fedora_elections/__init__.py
+++ b/fedora_elections/__init__.py
@@ -24,7 +24,7 @@
# Pierre-Yves Chibon <pingou(a)fedoraproject.org>
#
-__version__ = '2.5.3'
+__version__ = '2.5.4'
import logging
import os
diff --git a/files/fedora-elections.spec b/files/fedora-elections.spec
index 96660d9..1fa4d0f 100644
--- a/files/fedora-elections.spec
+++ b/files/fedora-elections.spec
@@ -1,7 +1,7 @@
%define modname fedora_elections
Name: fedora-elections
-Version: 2.5.3
+Version: 2.5.4
Release: 1%{?dist}
Summary: Fedora elections application
@@ -111,6 +111,11 @@ install -m 644 files/update_1_to_2.sql \
%changelog
+* Thu May 28 2015 Pierre-Yves Chibon <pingou(a)pingoured.fr> - 2.5.4-1
+- Update to 2.5.4
+- Fix displaying information about the simplified range voting method
+- Fix setting the max_vote value in the stats dict for the results page
+
* Tue May 05 2015 Pierre-Yves Chibon <pingou(a)pingoured.fr> - 2.5.3-1
- Update to 2.5.3
- Fix the simplified range voting