diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-30 17:52:39 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-30 17:52:39 +0100 |
commit | 9d0a2f2042613eb06717c6d1137243408b6ff21f (patch) | |
tree | 7c4f9109478ae74a408c63df383d01305ee45b9b /ishtar_common/tests.py | |
parent | d4c974cd0caf263b4133870f2a57ed99c1c04f73 (diff) | |
download | Ishtar-9d0a2f2042613eb06717c6d1137243408b6ff21f.tar.bz2 Ishtar-9d0a2f2042613eb06717c6d1137243408b6ff21f.zip |
Town: alter insee code for old towns
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index e107bd6fb..63d80d5ab 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -126,6 +126,7 @@ class CommandsTestCase(TestCase): q = models.Town.objects town_nb = q.count() first, union_start, union_end = '', '', [] + new_nums = [] for idx, town in enumerate(q.all()): x1 = float(idx) / 10 if not x1: @@ -140,6 +141,8 @@ class CommandsTestCase(TestCase): union_start += '{x2} 0.1'.format(x1=x1, x2=x2) union_end.append('{x2} 0'.format(x1=x1, x2=x2)) town.limit = l + town.year = 1792 + new_nums.append("{}-{}".format(town.numero_insee, town.year)) town.save() union = 'MULTIPOLYGON (((' + first + ", " + union_start + \ ", " + ", ".join(reversed(union_end)) + ", 0 0, " + first + ")))" @@ -157,6 +160,9 @@ class CommandsTestCase(TestCase): # no new town self.assertEqual(town_nb + 1, models.Town.objects.count()) + for parent_town in new.parents.all(): + self.assertIn(parent_town.numero_insee, new_nums) + class WizardTestFormData(object): """ |