diff options
author | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-05 18:12:23 (GMT) |
---|---|---|
committer | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-05 18:12:23 (GMT) |
commit | 6a9eb56a052b2dcdbc00956ae4479ff06c3ffa51 (patch) | |
tree | 1e2d49d6354643245c8db40384a7d2c09d2a2ca9 | |
parent | 4839732e7379a68b5e298fe9aa88009c98d00f43 (diff) |
get_data method for PollResultFile
-rw-r--r-- | webapp/polls/models.py | 3 | ||||
-rw-r--r-- | webapp/polls/tests/poll_result_file_tests.py | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/webapp/polls/models.py b/webapp/polls/models.py index 77a45dd..65f4a3d 100644 --- a/webapp/polls/models.py +++ b/webapp/polls/models.py @@ -1553,3 +1553,6 @@ class PollResultFile(object): poll_id = self.data['poll_id'] poll = Poll.get(poll_id) poll.add_result_files([(file_path, name)]) + + def get_data(self): + return self.data diff --git a/webapp/polls/tests/poll_result_file_tests.py b/webapp/polls/tests/poll_result_file_tests.py index 8342443..f1e80f9 100644 --- a/webapp/polls/tests/poll_result_file_tests.py +++ b/webapp/polls/tests/poll_result_file_tests.py @@ -132,3 +132,11 @@ class PollResultFileTest(MongoTestCase): result_name = poll.get_result_files()[0].get_file_name() self.assertEqual(chosen_name, result_name) + + def test_it_should_respond_with_data_structure(self): + data = self.data + file_path = self.make_temp_file(data) + poll_result_file = PollResultFile(file_path) + + expected_data = data + self.assertEqual(expected_data, poll_result_file.get_data()) |