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.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 4aa290ed1..e107bd6fb 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -127,14 +127,18 @@ class CommandsTestCase(TestCase):
town_nb = q.count()
first, union_start, union_end = '', '', []
for idx, town in enumerate(q.all()):
- l = 'MULTIPOLYGON((({x1} 1,{x2} 1,{x2} 0,{x1} 0,{x1} 1)))'.format(
- x1=idx, x2=idx + 1)
+ x1 = float(idx) / 10
+ if not x1:
+ x1 = 0
+ x2 = float(idx) / 10 + 0.1
+ l = 'MULTIPOLYGON((({x1} 0.1,{x2} 0.1,{x2} 0,{x1} 0,' \
+ '{x1} 0.1)))'.format(x1=x1, x2=x2)
if union_start:
union_start += ", "
else:
- first = '{x1} 1'.format(x1=idx)
- union_start += '{x2} 1'.format(x1=idx, x2=idx + 1)
- union_end.append('{x2} 0'.format(x1=idx, x2=idx + 1))
+ first = '{x1} 0.1'.format(x1=x1)
+ union_start += '{x2} 0.1'.format(x1=x1, x2=x2)
+ union_end.append('{x2} 0'.format(x1=x1, x2=x2))
town.limit = l
town.save()
union = 'MULTIPOLYGON (((' + first + ", " + union_start + \