From aaccdce8e7ebe6bc3a14e180c765a00dfee33991 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 16 Oct 2017 12:48:35 +0200 Subject: Towns relationship: include related towns to searches --- ishtar_common/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ishtar_common/tests.py') 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): -- cgit v1.2.3