diff --git a/tests/ticket_24615/__init__.py b/tests/ticket_24615/__init__.py
new file mode 100644
index 0000000..8f4a3fc
|
-
|
+
|
|
| | 1 | # -*- coding: utf-8 -*- |
| | 2 | from __future__ import print_function, unicode_literals |
diff --git a/tests/ticket_24615/models.py b/tests/ticket_24615/models.py
new file mode 100644
index 0000000..30b63f7
|
-
|
+
|
|
| | 1 | # -*- coding: utf-8 -*- |
| | 2 | from __future__ import print_function, unicode_literals |
| | 3 | from django.contrib.gis.db import models |
| | 4 | |
| | 5 | |
| | 6 | class SouthTexasCity(models.Model): |
| | 7 | "City model on projected coordinate system for South Texas." |
| | 8 | name = models.CharField(max_length=30) |
| | 9 | point = models.PointField(srid=32140) |
| | 10 | |
| | 11 | objects = models.GeoManager() |
diff --git a/tests/ticket_24615/tests.py b/tests/ticket_24615/tests.py
new file mode 100644
index 0000000..d9707cb
|
-
|
+
|
|
| | 1 | from __future__ import unicode_literals |
| | 2 | |
| | 3 | from unittest import skipUnless |
| | 4 | |
| | 5 | from django.contrib.gis.geos import HAS_GEOS |
| | 6 | # from django.contrib.gis.tests.utils import ( |
| | 7 | # HAS_SPATIAL_DB, mysql |
| | 8 | # ) |
| | 9 | from django.test import TestCase |
| | 10 | |
| | 11 | from django.contrib.gis.geos import Point |
| | 12 | |
| | 13 | from .models import SouthTexasCity |
| | 14 | |
| | 15 | |
| | 16 | class DistanceTest(TestCase): |
| | 17 | def test_distance_with_values_list(self): |
| | 18 | """ |
| | 19 | Test that distance() works in conjunction with values_list. |
| | 20 | """ |
| | 21 | qs = SouthTexasCity.objects.all().distance(Point(3, 3)).order_by('distance') |
| | 22 | self.assertIsInstance(list(qs), list) |
| | 23 | self.assertIsInstance(list(qs.values_list('point', flat=True)), list) |
| | 24 | self.assertIsInstance(list(qs.values_list('name', flat=True)), list) |