Skip to content

Commit

Permalink
[3.1.x] Fixed GeoIPTest.test04_city() failure with the latest GeoIP2 …
Browse files Browse the repository at this point in the history
…database.

Backport of 135c800 from master
  • Loading branch information
felixxm committed Jan 29, 2021
1 parent a271d8c commit 03a8678
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/gis_tests/test_geoip2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"GeoIP is required along with the GEOIP_PATH setting."
)
class GeoIPTest(SimpleTestCase):
addr = '75.41.39.1'
fqdn = 'tmc.edu'
addr = '129.237.192.1'
fqdn = 'ku.edu'

def test01_init(self):
"GeoIP initialization."
Expand Down Expand Up @@ -105,7 +105,7 @@ def test03_country(self, gethostbyname):
@mock.patch('socket.gethostbyname')
def test04_city(self, gethostbyname):
"GeoIP city querying methods."
gethostbyname.return_value = '75.41.39.1'
gethostbyname.return_value = '129.237.192.1'
g = GeoIP2(country='<foo>')

for query in (self.fqdn, self.addr):
Expand All @@ -130,8 +130,8 @@ def test04_city(self, gethostbyname):
self.assertEqual('NA', d['continent_code'])
self.assertEqual('North America', d['continent_name'])
self.assertEqual('US', d['country_code'])
self.assertEqual('Dallas', d['city'])
self.assertEqual('TX', d['region'])
self.assertEqual('Lawrence', d['city'])
self.assertEqual('KS', d['region'])
self.assertEqual('America/Chicago', d['time_zone'])
self.assertFalse(d['is_in_european_union'])
geom = g.geos(query)
Expand Down

0 comments on commit 03a8678

Please sign in to comment.