Commit 24f0f989 authored by Julien Cristau's avatar Julien Cristau
Browse files

[test] fix longitude/latitude confusion

parent aa9580b5f998
......@@ -33,20 +33,20 @@ class PostgisTC(testlib.CubicWebTC):
def test_geometry_srid(self):
with self.admin_access.repo_cnx() as cnx:
cnx.create_entity('City', name=u'Paris', center_4326=(u'POINT(48.4 2.34)', 4326))
cnx.create_entity('City', name=u'Paris', center_4326=(u'POINT(2.34 48.4)', 4326))
cnx.commit()
self.assertEqual(cnx.execute('Any ST_SRID(C) WHERE X center_4326 C')[0][0], 4326)
# wrong srid
with self.assertRaises(Exception) as ctx:
cnx.create_entity('City', name=u'Nantes', center_4326=(u'POINT(47.25 1.5)', -1))
cnx.create_entity('City', name=u'Nantes', center_4326=(u'POINT(1.5 47.25)', -1))
self.assertEqual(ctx.exception.__class__.__name__, 'DataError')
def test_geometry_nosrid(self):
with self.admin_access.repo_cnx() as cnx:
cnx.create_entity('City', name=u'Paris', center_nosrid=(u'POINT(48.4 2.34)', 4326))
cnx.create_entity('City', name=u'Paris', center_nosrid=(u'POINT(2.34 48.4)', 4326))
cnx.commit()
self.assertEqual(cnx.execute('Any ST_SRID(C) WHERE X center_nosrid C')[0][0], 4326)
cnx.create_entity('City', name=u'Nantes', center_nosrid=(u'POINT(47.25 1.5)', -1))
cnx.create_entity('City', name=u'Nantes', center_nosrid=(u'POINT(1.5 47.25)', -1))
cnx.commit()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment