Fixed skipping of gis_tests when dependencies not installed.

This commit is contained in:
Tim Graham 2015-03-28 09:39:09 -04:00
parent 6de3a1e2c3
commit ba1665ed75
1 changed files with 2 additions and 1 deletions

View File

@ -4,7 +4,6 @@ from __future__ import unicode_literals
from unittest import skipUnless from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.maps.google.overlays import GEvent, GOverlayBase
from django.test import TestCase from django.test import TestCase
from django.test.utils import modify_settings, override_settings from django.test.utils import modify_settings, override_settings
from django.utils.encoding import force_text from django.utils.encoding import force_text
@ -45,11 +44,13 @@ class GoogleMapsTest(TestCase):
self.assertIn("En français", google_map.scripts) self.assertIn("En français", google_map.scripts)
def test_gevent_html_safe(self): def test_gevent_html_safe(self):
from django.contrib.gis.maps.google.overlays import GEvent
event = GEvent('click', 'function() {location.href = "http://www.google.com"}') event = GEvent('click', 'function() {location.href = "http://www.google.com"}')
self.assertTrue(hasattr(GEvent, '__html__')) self.assertTrue(hasattr(GEvent, '__html__'))
self.assertEqual(force_text(event), event.__html__()) self.assertEqual(force_text(event), event.__html__())
def test_goverlay_html_safe(self): def test_goverlay_html_safe(self):
from django.contrib.gis.maps.google.overlays import GOverlayBase
overlay = GOverlayBase() overlay = GOverlayBase()
overlay.js_params = '"foo", "bar"' overlay.js_params = '"foo", "bar"'
self.assertTrue(hasattr(GOverlayBase, '__html__')) self.assertTrue(hasattr(GOverlayBase, '__html__'))