diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-16 12:48:35 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-16 12:48:35 +0200 |
commit | aaccdce8e7ebe6bc3a14e180c765a00dfee33991 (patch) | |
tree | a70ed54803f98a8f35b05df3eb761f690ec85530 /ishtar_common/tests.py | |
parent | 8a003f0a6e02f298745ec6dc62cf1204bfb9dc33 (diff) | |
download | Ishtar-aaccdce8e7ebe6bc3a14e180c765a00dfee33991.tar.bz2 Ishtar-aaccdce8e7ebe6bc3a14e180c765a00dfee33991.zip |
Towns relationship: include related towns to searches
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 349408465..8a951b29a 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -1046,6 +1046,15 @@ class IshtarBasicTest(TestCase): self.assertEqual(response.status_code, 200) self.assertIn('class="sheet"', response.content) + def test_town_cache(self): + models.Town.objects.create(name="Sin City", numero_insee="99999") + town = models.Town.objects.get(numero_insee="99999") + self.assertEqual(town.cached_label, "Sin City - 99") + town.year = 2050 + town.save() + town = models.Town.objects.get(numero_insee="99999") + self.assertEqual(town.cached_label, "Sin City - 99 (2050)") + class GeomaticTest(TestCase): def test_post_save_point(self): |