Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webapp/polls/tests/structure_tests.py
diff options
context:
space:
mode:
authorRogelio Mita <rogeliomita@activitycentral.com>2013-07-30 14:07:46 (GMT)
committer Code Raguet <ignacio.code@gmail.com>2013-07-30 14:09:26 (GMT)
commit22fd4169dbda03de52dde2371ebd7feb05acf223 (patch)
treef114fb7078e2b024f403c150c07a840ce48f4304 /webapp/polls/tests/structure_tests.py
parent0eb5a5ee47e3efbb6f0a4ec4c86d93ec23d2a2bb (diff)
first impression
Diffstat (limited to 'webapp/polls/tests/structure_tests.py')
-rw-r--r--webapp/polls/tests/structure_tests.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/webapp/polls/tests/structure_tests.py b/webapp/polls/tests/structure_tests.py
index a91f854..8c2e931 100644
--- a/webapp/polls/tests/structure_tests.py
+++ b/webapp/polls/tests/structure_tests.py
@@ -219,3 +219,34 @@ class StructureTests(MongoTestCase):
structure.add_group(group, group.order)
self.assertEqual(expected, structure.to_python())
+
+ def test_structure_with_a_question_with_img(self):
+
+ poll = Poll({"name": "poll name"})
+ poll_id = poll.save()
+ poll = poll.get(poll_id)
+ img = "img"
+ data = {
+ 'groups': {
+ '0': {
+ 'name': "group name",
+ 'fields': {
+ '0': {
+ 'name': "field_0_0",
+ 'widget_type': Field.TextInput,
+ 'options': {
+ '131212': {
+ 'text': "text",
+ 'order': 0
+ }
+ },
+ 'img': img
+ }
+ }
+ }
+ }
+ }
+
+ structure = Structure(data=data, poll=poll)
+
+ self.assertEqual(img, structure.groups[0].fields[0].img)