[1.11.x] Fixed a test failure with the latest GeoIP databases.

Backport of 7a22d9f75125e3cfbea0979a876efe4634f6fe05 from master
This commit is contained in:
Tim Graham 2018-04-17 21:30:05 -04:00
parent 4a20aae468
commit 800778f7ad
2 changed files with 4 additions and 4 deletions

View File

@ -145,7 +145,7 @@ class GeoIPTest(unittest.TestCase):
fqdn = "messe-duesseldorf.com"
if self._is_dns_available(fqdn):
d = g.city(fqdn)
self.assertEqual('Essen', d['city'])
self.assertEqual('Düsseldorf', d['city'])
d = g.country('200.26.205.1')
# Some databases have only unaccented countries
self.assertIn(d['country_name'], ('Curaçao', 'Curacao'))

View File

@ -137,10 +137,10 @@ class GeoIPTest(unittest.TestCase):
@mock.patch('socket.gethostbyname')
def test05_unicode_response(self, gethostbyname):
"GeoIP strings should be properly encoded (#16553)."
gethostbyname.return_value = '191.252.51.69'
gethostbyname.return_value = '194.27.42.76'
g = GeoIP2()
d = g.city('www.fasano.com.br')
self.assertEqual(d['city'], 'São José dos Campos')
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'))