Typo in assignment view (fixed #805)

This commit is contained in:
Norman Jäckel 2013-07-04 15:01:08 +02:00
parent af1acf1839
commit 834851acbd
2 changed files with 27 additions and 1 deletions

View File

@ -121,7 +121,7 @@
{% endif %}
{% endif %}
{% if perms.assignment.can_manage_assignments and blocked_candidates and assignment.status != "fin" %}
{% if perms.assignment.can_manage_assignment and blocked_candidates and assignment.status != "fin" %}
<h4>{% trans "Blocked Candidates" %}</h4>
<ul>
{% for person in blocked_candidates %}

View File

@ -64,3 +64,29 @@ class TestAssignmentPollDelete(AssignmentViewTestCase):
def test_post(self):
response = self.admin_client.post('/assignment/poll/1/del/', {'yes': 1})
self.assertRedirects(response, '/assignment/1/')
class TestAssignmentDetailView(AssignmentViewTestCase):
def test_blocked_candidates_view(self):
"""
Tests that a delegate runs for a vote and then withdraws himself.
"""
response = self.staff_client.get('/assignment/1/')
self.assertContains(response, 'No candidates available.')
self.assertNotContains(response, 'Blocked Candidates')
response = self.delegate_client.get('/assignment/1/run/')
self.assertTrue(self.assignment1.is_candidate(self.delegate))
self.assertFalse(self.assignment1.is_blocked(self.delegate))
response = self.staff_client.get('/assignment/1/')
self.assertNotContains(response, 'No candidates available.')
self.assertNotContains(response, 'Blocked Candidates')
response = self.delegate_client.get('/assignment/1/delrun/')
self.assertFalse(self.assignment1.is_candidate(self.delegate))
self.assertTrue(self.assignment1.is_blocked(self.delegate))
response = self.staff_client.get('/assignment/1/')
self.assertContains(response, 'No candidates available.')
self.assertContains(response, 'Blocked Candidates')