diff options
author | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-26 14:31:49 (GMT) |
---|---|---|
committer | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-26 14:31:49 (GMT) |
commit | c312ce1316d390c4f4c638e028a319379ce5e708 (patch) | |
tree | 4d833dc14839d2d180d03efef3fd1be7b7e7ebef /webapp/polls/tests/structure_tests.py | |
parent | 73987e8944f866e691ce4ddb2593ac7176aa0fae (diff) |
Disable "Modificar estructura" button when a poll is read_only
Diffstat (limited to 'webapp/polls/tests/structure_tests.py')
-rw-r--r-- | webapp/polls/tests/structure_tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/webapp/polls/tests/structure_tests.py b/webapp/polls/tests/structure_tests.py index ba30c91..c9fe0d9 100644 --- a/webapp/polls/tests/structure_tests.py +++ b/webapp/polls/tests/structure_tests.py @@ -332,6 +332,18 @@ class ReadOnlyTest(MongoTestCase): self.assertTrue(poll.has_result()) self.assertTrue(structure.is_read_only()) + def test_read_only_when_poll_is_closed_and_has_not_results(self): + poll = self.poll + poll.status = Poll.CLOSED + poll_id = poll.save() + poll = poll.get(poll_id) + + structure = Structure(data={}, poll=poll) + self.assertFalse(poll.has_result()) + self.assertFalse(poll.is_open()) + + self.assertTrue(structure.is_read_only()) + class UploadOptionImagesTest(MongoTestCase): |