Skip to content

Commit 03a8678

Browse files
committed
[3.1.x] Fixed GeoIPTest.test04_city() failure with the latest GeoIP2 database.
Backport of 135c800 from master
1 parent a271d8c commit 03a8678

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/gis_tests/test_geoip2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"GeoIP is required along with the GEOIP_PATH setting."
2121
)
2222
class GeoIPTest(SimpleTestCase):
23-
addr = '75.41.39.1'
24-
fqdn = 'tmc.edu'
23+
addr = '129.237.192.1'
24+
fqdn = 'ku.edu'
2525

2626
def test01_init(self):
2727
"GeoIP initialization."
@@ -105,7 +105,7 @@ def test03_country(self, gethostbyname):
105105
@mock.patch('socket.gethostbyname')
106106
def test04_city(self, gethostbyname):
107107
"GeoIP city querying methods."
108-
gethostbyname.return_value = '75.41.39.1'
108+
gethostbyname.return_value = '129.237.192.1'
109109
g = GeoIP2(country='<foo>')
110110

111111
for query in (self.fqdn, self.addr):
@@ -130,8 +130,8 @@ def test04_city(self, gethostbyname):
130130
self.assertEqual('NA', d['continent_code'])
131131
self.assertEqual('North America', d['continent_name'])
132132
self.assertEqual('US', d['country_code'])
133-
self.assertEqual('Dallas', d['city'])
134-
self.assertEqual('TX', d['region'])
133+
self.assertEqual('Lawrence', d['city'])
134+
self.assertEqual('KS', d['region'])
135135
self.assertEqual('America/Chicago', d['time_zone'])
136136
self.assertFalse(d['is_in_european_union'])
137137
geom = g.geos(query)

0 commit comments

Comments
 (0)