diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-30 15:57:38 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-30 15:57:38 +0100 |
| commit | c1e94dc1b8851b61bc8d697e08f8a407b5269365 (patch) | |
| tree | 7d05ced66e557804795fb8e1a3540252bfd426d8 /archaeological_finds | |
| parent | 4a6c5fa994e583ba057eb78e398c626c41144636 (diff) | |
| parent | 2623764591c43c79b48e08b5e13ab3c01a9a83a0 (diff) | |
| download | Ishtar-c1e94dc1b8851b61bc8d697e08f8a407b5269365.tar.bz2 Ishtar-c1e94dc1b8851b61bc8d697e08f8a407b5269365.zip | |
Merge branch 'master' into v0.9
Diffstat (limited to 'archaeological_finds')
| -rw-r--r-- | archaeological_finds/models_finds.py | 2 | ||||
| -rw-r--r-- | archaeological_finds/tests.py | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 651559426..bbb74e4f3 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -308,7 +308,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): CHECK_DICT = dict(CHECK_CHOICES) SHOW_URL = 'show-find' SLUG = 'find' - TABLE_COLS = ['label', 'material_types', 'datings__period__label', + TABLE_COLS = ['label', 'material_types__label', 'datings__period__label', 'base_finds__context_record__parcel__town', 'base_finds__context_record__operation__year', 'base_finds__context_record__operation__operation_code', diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 34f95cf7d..f0112123b 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -367,7 +367,10 @@ class FindSearchTest(FindInit, TestCase): # one result for exact search response = c.get(reverse('get-find'), search) self.assertEqual(response.status_code, 200) - self.assertTrue(json.loads(response.content)['total'] == 1) + res = json.loads(response.content) + self.assertTrue(res['total'] == 1) + self.assertEqual(res["rows"][0]["material_types__label"], + unicode(iron_metal)) # no result for the brother search = {'material_types': not_iron_metal.pk} @@ -404,7 +407,10 @@ class FindSearchTest(FindInit, TestCase): c.login(username=self.username, password=self.password) response = c.get(reverse('get-find'), search) self.assertEqual(response.status_code, 200) - self.assertEqual(json.loads(response.content)['total'], 1) + res = json.loads(response.content) + self.assertTrue(res['total'] == 1) + self.assertEqual(res["rows"][0]["datings__period__label"], + unicode(final_neo)) # no result for the brother search = {'datings__period': recent_neo.pk} |
