Merge pull request #1081 from normanjaeckel/100-Percent-String

Add percent base value to all polls, fix #1079.
This commit is contained in:
Oskar Hahn 2013-11-19 08:11:55 -08:00
commit 77bbfc963d
3 changed files with 14 additions and 1 deletions

View File

@ -20,6 +20,8 @@ Motions:
- Enabled attachments for motions. - Enabled attachments for motions.
Elections: Elections:
- Refactored assignment app to use class based views instead of functions. - Refactored assignment app to use class based views instead of functions.
Polls:
- Added percent base to votes cast values.
Participants: Participants:
- Updated access data PDF: WLAN access (with QRCode for WLAN ssid/password) - Updated access data PDF: WLAN access (with QRCode for WLAN ssid/password)
and OpenSlides access (with QRCode for system URL), printed on a single A4 page and OpenSlides access (with QRCode for system URL), printed on a single A4 page

View File

@ -70,7 +70,7 @@ class CountVotesCast(models.Model):
fields.append('votescast') fields.append('votescast')
def print_votescast(self): def print_votescast(self):
return print_value(self.votescast) return print_value(self.votescast, self.percent_base())
def percent_base(self): def percent_base(self):
if self.votescast > 0: if self.votescast > 0:

View File

@ -80,6 +80,17 @@ class TestMotionDetailView(MotionViewTestCase):
self.assertNotContains(response, '<h4>Attachments:</h4>') self.assertNotContains(response, '<h4>Attachments:</h4>')
self.assertNotContains(response, 'TestFile_Neiri4xai4ueseGohzid') self.assertNotContains(response, 'TestFile_Neiri4xai4ueseGohzid')
def test_poll(self):
response = self.staff_client.get('/motion/1/create_poll/')
self.assertRedirects(response, '/motion/1/poll/1/edit/')
response = self.staff_client.post(
'/motion/1/poll/1/edit/',
{'option-1-Yes': '10',
'pollform-votescast': '50'})
self.assertRedirects(response, '/motion/1/')
response = self.staff_client.get('/motion/1/')
self.assertContains(response, '100.00 %')
class TestMotionDetailVersionView(MotionViewTestCase): class TestMotionDetailVersionView(MotionViewTestCase):
def test_get(self): def test_get(self):