Fixed GeoIPTest.test04_city() failure with the latest GeoIP2 database.

This commit is contained in:
Mariusz Felisiak 2019-06-27 15:09:28 +02:00 committed by GitHub
parent 26d16c07fd
commit 4305fbe8b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ if HAS_GEOIP2:
"GeoIP is required along with the GEOIP_PATH setting."
)
class GeoIPTest(SimpleTestCase):
addr = '128.249.1.1'
addr = '75.41.39.1'
fqdn = 'tmc.edu'
def test01_init(self):
@ -99,7 +99,7 @@ class GeoIPTest(SimpleTestCase):
@mock.patch('socket.gethostbyname')
def test04_city(self, gethostbyname):
"GeoIP city querying methods."
gethostbyname.return_value = '128.249.1.1'
gethostbyname.return_value = '75.41.39.1'
g = GeoIP2(country='<foo>')
for query in (self.fqdn, self.addr):
@ -124,7 +124,7 @@ class GeoIPTest(SimpleTestCase):
self.assertEqual('NA', d['continent_code'])
self.assertEqual('North America', d['continent_name'])
self.assertEqual('US', d['country_code'])
self.assertEqual('Houston', d['city'])
self.assertEqual('Dallas', d['city'])
self.assertEqual('TX', d['region'])
self.assertEqual('America/Chicago', d['time_zone'])
self.assertFalse(d['is_in_european_union'])