summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-01-27 09:25:49 -0500
committerTim Graham <timograham@gmail.com>2016-01-28 18:02:10 -0500
commitefd855481581b5758d866a009bbd1074e74869b4 (patch)
tree60494dcfd68c53185ad3fd448f5674e87e8ade0c /tests
parent61452616baca63fa58efbb5991f65ba362eccbe2 (diff)
[1.9.x] Fixed #20415 -- Ensured srid isn't localized in OpenLayers JavaScript.
Backport of 19d1cb14519186902d7e27813bf2643fe3f7cfa3 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/test_geoforms.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/gis_tests/test_geoforms.py b/tests/gis_tests/test_geoforms.py
index 836c720c03..317389da84 100644
--- a/tests/gis_tests/test_geoforms.py
+++ b/tests/gis_tests/test_geoforms.py
@@ -4,7 +4,7 @@ from django.contrib.gis import forms
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.forms import ValidationError
-from django.test import SimpleTestCase, skipUnlessDBFeature
+from django.test import SimpleTestCase, override_settings, skipUnlessDBFeature
from django.utils import six
from django.utils.html import escape
@@ -152,6 +152,7 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertTrue(form_instance.is_valid())
rendered = form_instance.as_p()
self.assertIn('new MapWidget(options);', rendered)
+ self.assertIn('map_srid: 4326,', rendered)
self.assertIn('gis/js/OLMapWidget.js', str(form_instance.media))
def assertTextarea(self, geom, rendered):
@@ -161,6 +162,8 @@ class SpecializedFieldTest(SimpleTestCase):
self.assertIn('required', rendered)
self.assertIn(geom.wkt, rendered)
+ # map_srid in operlayers.html template must not be localized.
+ @override_settings(USE_L10N=True, USE_THOUSAND_SEPARATOR=True)
def test_pointfield(self):
class PointForm(forms.Form):
p = forms.PointField()