Merge pull request #1084 from normanjaeckel/EmptyPersonFix
Fix method for empty person, fixes #1077
This commit is contained in:
commit
d889be6db6
2
fabfile.py
vendored
2
fabfile.py
vendored
@ -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():
|
||||
|
@ -44,13 +44,13 @@ def absolute_url(model, link=None):
|
||||
|
||||
Example: {{ motion|absolute_url:'delete' }}
|
||||
"""
|
||||
if link is None:
|
||||
url = model.get_absolute_url()
|
||||
else:
|
||||
try:
|
||||
try:
|
||||
if link is None:
|
||||
url = model.get_absolute_url()
|
||||
else:
|
||||
url = model.get_absolute_url(link)
|
||||
except ValueError:
|
||||
url = ''
|
||||
except ValueError:
|
||||
url = ''
|
||||
return url
|
||||
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user