Fix templatetag, #1077.

This commit is contained in:
Norman Jäckel 2013-11-19 01:26:39 +01:00
parent 3d19ae7db2
commit c34b407945
3 changed files with 15 additions and 7 deletions

2
fabfile.py vendored
View File

@ -25,7 +25,7 @@ def coverage_report_plain():
Runs all tests and prints the coverage report.
"""
test()
local('coverage report -m --fail-under=73')
local('coverage report -m --fail-under=75')
def coverage():

View File

@ -44,10 +44,10 @@ def absolute_url(model, link=None):
Example: {{ motion|absolute_url:'delete' }}
"""
try:
if link is None:
url = model.get_absolute_url()
else:
try:
url = model.get_absolute_url(link)
except ValueError:
url = ''

View File

@ -91,6 +91,14 @@ class TestMotionDetailView(MotionViewTestCase):
response = self.staff_client.get('/motion/1/')
self.assertContains(response, '100.00 %')
def test_deleted_supporter(self):
config['motion_min_supporters'] = 1
self.motion1.support(self.registered)
self.assertContains(self.admin_client.get('/motion/1/'), 'registered')
self.registered.delete()
self.assertNotContains(self.admin_client.get('/motion/1/'), 'registered')
self.assertContains(self.admin_client.get('/motion/1/'), 'empty')
class TestMotionDetailVersionView(MotionViewTestCase):
def test_get(self):