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 @@ -13,6 +13,18 @@ GOOGLE_MAPS_API_KEY = 'XXXX' @skipUnless(HAS_GEOS, 'Geos is required.') 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): """