Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a GeoDjango test with a raw query (Refs #17448)

Thanks David Eklund for the initial patch.
  • Loading branch information...
commit d7a2e816a15a121c50b85c4470c91a676cbc827b 1 parent b7c3b04
@claudep claudep authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 django/contrib/gis/tests/geoapp/
7 django/contrib/gis/tests/geoapp/
@@ -186,6 +186,13 @@ def test_inherited_geofields(self):
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):
Please sign in to comment.
Something went wrong with that request. Please try again.