summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-02-03 16:22:10 +0100
committerClaude Paroz <claude@2xlibre.net>2014-02-03 16:22:10 +0100
commit6e0f1bc06df87453875e639f66cb608bcb393429 (patch)
treeff523e64e18386a96c12d4ae8af8d831e4a115c2
parente7e3435b4d0d409aa98a66d2d7961f7541d19f9f (diff)
Moved a GoogleMap test
-rw-r--r--django/contrib/gis/tests/geoadmin/tests.py16
-rw-r--r--django/contrib/gis/tests/maps/tests.py12
2 files changed, 13 insertions, 15 deletions
diff --git a/django/contrib/gis/tests/geoadmin/tests.py b/django/contrib/gis/tests/geoadmin/tests.py
index 06a8ed245a..5cd3c2eee2 100644
--- a/django/contrib/gis/tests/geoadmin/tests.py
+++ b/django/contrib/gis/tests/geoadmin/tests.py
@@ -4,7 +4,7 @@ from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
-from django.test import TestCase, override_settings
+from django.test import TestCase
if HAS_GEOS and HAS_SPATIAL_DB:
from django.contrib.gis import admin
@@ -12,8 +12,6 @@ if HAS_GEOS and HAS_SPATIAL_DB:
from .models import City
-GOOGLE_MAPS_API_KEY = 'XXXX'
-
@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.")
class GeoAdminTest(TestCase):
@@ -59,15 +57,3 @@ class GeoAdminTest(TestCase):
self.assertFalse(has_changed(initial, data_same))
self.assertFalse(has_changed(initial, data_almost_same))
self.assertTrue(has_changed(initial, data_changed))
-
- @override_settings(GOOGLE_MAPS_API_KEY=GOOGLE_MAPS_API_KEY)
- def test_google_map_scripts(self):
- """
- Testing GoogleMap.scripts() output. See #20773.
- """
- from django.contrib.gis.maps.google.gmap import GoogleMap
-
- google_map = GoogleMap()
- scripts = google_map.scripts
- self.assertIn(GOOGLE_MAPS_API_KEY, scripts)
- self.assertIn("new GMap2", scripts)
diff --git a/django/contrib/gis/tests/maps/tests.py b/django/contrib/gis/tests/maps/tests.py
index d0832fcbb0..a2a7cd4cc2 100644
--- a/django/contrib/gis/tests/maps/tests.py
+++ b/django/contrib/gis/tests/maps/tests.py
@@ -14,6 +14,18 @@ GOOGLE_MAPS_API_KEY = 'XXXX'
class GoogleMapsTest(TestCase):
@override_settings(GOOGLE_MAPS_API_KEY=GOOGLE_MAPS_API_KEY)
+ def test_google_map_scripts(self):
+ """
+ Testing GoogleMap.scripts() output. See #20773.
+ """
+ from django.contrib.gis.maps.google.gmap import GoogleMap
+
+ google_map = GoogleMap()
+ scripts = google_map.scripts
+ self.assertIn(GOOGLE_MAPS_API_KEY, scripts)
+ self.assertIn("new GMap2", scripts)
+
+ @override_settings(GOOGLE_MAPS_API_KEY=GOOGLE_MAPS_API_KEY)
def test_unicode_in_google_maps(self):
"""
Test that GoogleMap doesn't crash with non-ascii content.