diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-25 10:52:57 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-25 11:12:43 +0200 |
| commit | d7a2e816a15a121c50b85c4470c91a676cbc827b (patch) | |
| tree | a4a5dddb0a41c9bc899de614c4e079d22ab1d855 | |
| parent | b7c3b044fcc354f675ff1941d9e4377d6782394c (diff) | |
Added a GeoDjango test with a raw query (Refs #17448)
Thanks David Eklund for the initial patch.
| -rw-r--r-- | django/contrib/gis/tests/geoapp/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index b06d6b5e1b..d989b50ada 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -186,6 +186,13 @@ class GeoModelTest(TestCase): self.assertEqual(1, qs.count()) for pc in qs: self.assertEqual(32128, pc.point.srid) + def test_raw_sql_query(self): + "Testing raw SQL query." + cities1 = City.objects.all() + cities2 = City.objects.raw('select * from geoapp_city') + self.assertEqual(len(cities1), len(list(cities2))) + self.assertTrue(isinstance(cities2[0].point, Point)) + class GeoLookupTest(TestCase): |
