Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCode Raguet <ignacio.code@gmail.com>2013-09-06 13:56:27 (GMT)
committer Code Raguet <ignacio.code@gmail.com>2013-09-06 16:13:01 (GMT)
commit774c03c638a54fd88ebbcb612315b781397ffa62 (patch)
tree518e69cc754e327855c64e008805d492b8979d4a
parent647116edafb062624ee0dc10077392321692c4a1 (diff)
get_numero_escuela now returns a python set
-rw-r--r--webapp/polls/models.py2
-rw-r--r--webapp/polls/tests/poll_result_file_tests.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/webapp/polls/models.py b/webapp/polls/models.py
index 2e34a90..50f3ca9 100644
--- a/webapp/polls/models.py
+++ b/webapp/polls/models.py
@@ -1519,7 +1519,7 @@ class PollResultFile(object):
self.data = json.loads(self.json_str, 'utf-8')
def get_numero_escuela(self):
- return self.data['result']['0']['polled']['NUM_ESC']
+ return set([self.data['result']['0']['polled']['NUM_ESC']])
def get_pollster_username(self):
return self.data['pollster_username']
diff --git a/webapp/polls/tests/poll_result_file_tests.py b/webapp/polls/tests/poll_result_file_tests.py
index 2ff63e8..b57e475 100644
--- a/webapp/polls/tests/poll_result_file_tests.py
+++ b/webapp/polls/tests/poll_result_file_tests.py
@@ -150,7 +150,7 @@ class NumeroEscuelaTest(MongoTestCase):
data['result']['0']['polled'] = {}
self.data = data
- def test_it_should_respond_to_numero_escuela(self):
+ def test_it_should_respond_to_numero_escuela_as_a_set(self):
data = self.data
numero_escuela = '1'
data['result']['0']['polled']['NUM_ESC'] = numero_escuela
@@ -163,4 +163,4 @@ class NumeroEscuelaTest(MongoTestCase):
file_path = file_.name
result = PollResultFile(file_path)
- self.assertEqual(numero_escuela, result.get_numero_escuela())
+ self.assertEqual(set([numero_escuela]), result.get_numero_escuela())