mirror of
https://github.com/django/django.git
synced 2025-07-20 17:49:12 +00:00
[1.8.x] Fixed nonexistent tmc.edu domain in GeoIP test.
Backport of e1f6eba033abea25cd6b0577bd66c655ec453325 from master
This commit is contained in:
parent
3141b79d26
commit
1c4334f793
@ -26,8 +26,8 @@ if HAS_GEOS:
|
|||||||
@skipUnless(HAS_GEOIP and getattr(settings, "GEOIP_PATH", None),
|
@skipUnless(HAS_GEOIP and getattr(settings, "GEOIP_PATH", None),
|
||||||
"GeoIP is required along with the GEOIP_PATH setting.")
|
"GeoIP is required along with the GEOIP_PATH setting.")
|
||||||
class GeoIPTest(unittest.TestCase):
|
class GeoIPTest(unittest.TestCase):
|
||||||
addr = '128.249.1.1'
|
addr = '162.242.220.127'
|
||||||
fqdn = 'tmc.edu'
|
fqdn = 'www.djangoproject.com'
|
||||||
|
|
||||||
def test01_init(self):
|
def test01_init(self):
|
||||||
"Testing GeoIP initialization."
|
"Testing GeoIP initialization."
|
||||||
@ -98,12 +98,12 @@ class GeoIPTest(unittest.TestCase):
|
|||||||
# City information dictionary.
|
# City information dictionary.
|
||||||
d = g.city(query)
|
d = g.city(query)
|
||||||
self.assertEqual('USA', d['country_code3'])
|
self.assertEqual('USA', d['country_code3'])
|
||||||
self.assertEqual('Houston', d['city'])
|
self.assertEqual('San Antonio', d['city'])
|
||||||
self.assertEqual('TX', d['region'])
|
self.assertEqual('TX', d['region'])
|
||||||
self.assertEqual(713, d['area_code'])
|
self.assertEqual(210, d['area_code'])
|
||||||
geom = g.geos(query)
|
geom = g.geos(query)
|
||||||
self.assertIsInstance(geom, GEOSGeometry)
|
self.assertIsInstance(geom, GEOSGeometry)
|
||||||
lon, lat = (-95.4010, 29.7079)
|
lon, lat = (-98, 29)
|
||||||
lat_lon = g.lat_lon(query)
|
lat_lon = g.lat_lon(query)
|
||||||
lat_lon = (lat_lon[1], lat_lon[0])
|
lat_lon = (lat_lon[1], lat_lon[0])
|
||||||
for tup in (geom.tuple, g.coords(query), g.lon_lat(query), lat_lon):
|
for tup in (geom.tuple, g.coords(query), g.lon_lat(query), lat_lon):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user