Skip to content

Commit

Permalink
test dicts rather than dict keys only
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed Oct 3, 2013
1 parent ec482ca commit 2eafc20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
DATE = u"_date"
GEOLOCATION = u"_geolocation"
SUBMISSION_TIME = u'_submission_time'
DELETEDAT = "_deleted_at" # marker for delete surveys
DELETEDAT = u"_deleted_at" # marker for delete surveys
BAMBOO_DATASET_ID = u"_bamboo_dataset_id"

META_INSTANCE_ID = u"meta/instanceID"
Expand Down
8 changes: 4 additions & 4 deletions main/tests/test_form_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_api(self):
d = dict_for_mongo_without_userform_id(
self.xform.surveys.all()[0].parsed_instance)
find_d = json.loads(response.content)[0]
self.assertEqual(sorted(find_d, key=find_d.get), sorted(d, key=d.get))
self.assertEqual(find_d, d)

def test_api_with_query(self):
# query string
Expand All @@ -43,7 +43,7 @@ def test_api_with_query(self):
self.assertEqual(response.status_code, 200)
d = dict_for_mongo_without_userform_id(self.xform.surveys.all()[0].parsed_instance)
find_d = json.loads(response.content)[0]
self.assertEqual(sorted(find_d, key=find_d.get), sorted(d, key=d.get))
self.assertEqual(find_d, d)

def test_api_query_no_records(self):
# query string
Expand All @@ -70,7 +70,7 @@ def test_api_jsonp(self):
content = response.content[start: end]
d = dict_for_mongo_without_userform_id(self.xform.surveys.all()[0].parsed_instance)
find_d = json.loads(content)[0]
self.assertEqual(sorted(find_d, key=find_d.get), sorted(d, key=d.get))
self.assertEqual(find_d, d)

def test_api_with_query_start_limit(self):
# query string
Expand All @@ -80,7 +80,7 @@ def test_api_with_query_start_limit(self):
self.assertEqual(response.status_code, 200)
d = dict_for_mongo_without_userform_id(self.xform.surveys.all()[0].parsed_instance)
find_d = json.loads(response.content)[0]
self.assertEqual(sorted(find_d, key=find_d.get), sorted(d, key=d.get))
self.assertEqual(find_d, d)

def test_api_with_query_invalid_start_limit(self):
# query string
Expand Down

0 comments on commit 2eafc20

Please sign in to comment.