summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTom Forbes <tom@tomforb.es>2018-10-24 01:46:49 +0100
committerTim Graham <timograham@gmail.com>2018-11-10 16:34:03 -0500
commit0ecc4f8d497679979f48ff18754494e8387a494d (patch)
treed9a06729a8716bba05396687535b87d6db25df99 /tests
parentb5702dac7fcd903ba41b320b2ba7cd2266428e7a (diff)
downloaddjango-0ecc4f8d497679979f48ff18754494e8387a494d.tar.gz
[1.11.x] Removed obsolete and flaky GeoIP tests.
Backport of 8f90593e6f8197148c8f86e598bfef6792f3f4bf from master.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/test_geoip2.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/tests/gis_tests/test_geoip2.py b/tests/gis_tests/test_geoip2.py
index 414d9e492b..b15d0fc6ee 100644
--- a/tests/gis_tests/test_geoip2.py
+++ b/tests/gis_tests/test_geoip2.py
@@ -127,23 +127,10 @@ class GeoIPTest(unittest.TestCase):
geom = g.geos(query)
self.assertIsInstance(geom, GEOSGeometry)
- lon, lat = (-95.4010, 29.7079)
- lat_lon = g.lat_lon(query)
- lat_lon = (lat_lon[1], lat_lon[0])
- for tup in (geom.tuple, g.coords(query), g.lon_lat(query), lat_lon):
- self.assertAlmostEqual(lon, tup[0], 4)
- self.assertAlmostEqual(lat, tup[1], 4)
- @mock.patch('socket.gethostbyname')
- def test05_unicode_response(self, gethostbyname):
- "GeoIP strings should be properly encoded (#16553)."
- gethostbyname.return_value = '194.27.42.76'
- g = GeoIP2()
- d = g.city('nigde.edu.tr')
- self.assertEqual('Niğde', d['city'])
- d = g.country('200.26.205.1')
- # Some databases have only unaccented countries
- self.assertIn(d['country_name'], ('Curaçao', 'Curacao'))
+ for e1, e2 in (geom.tuple, g.coords(query), g.lon_lat(query), g.lat_lon(query)):
+ self.assertIsInstance(e1, float)
+ self.assertIsInstance(e2, float)
def test06_ipv6_query(self):
"GeoIP can lookup IPv6 addresses."