summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py6
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):
"""