summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-10-31 18:16:11 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-10-31 18:16:11 +0100
commit54970e5dd633e6c9971ea1a2bc594950a851bd90 (patch)
tree5da5ddd928f4bdf9eff103e13f6c72d08747899f /ishtar_common/tests.py
parentc48273fbf6e11e4e373a6f218496dc4764625b3e (diff)
parentcdfcbddf13e02ceec6946da01b08cccb40d8cb9e (diff)
downloadIshtar-54970e5dd633e6c9971ea1a2bc594950a851bd90.tar.bz2
Ishtar-54970e5dd633e6c9971ea1a2bc594950a851bd90.zip
Merge branch 'develop' into develop-bootstrap
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):
"""