Fixed a test failure with the latest GeoIP2 database.

This commit is contained in:
Tim Graham 2018-04-17 21:30:05 -04:00 committed by GitHub
parent 64b74804c5
commit 7a22d9f751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -140,10 +140,10 @@ class GeoIPTest(SimpleTestCase):
@mock.patch('socket.gethostbyname') @mock.patch('socket.gethostbyname')
def test05_unicode_response(self, gethostbyname): def test05_unicode_response(self, gethostbyname):
"GeoIP strings should be properly encoded (#16553)." "GeoIP strings should be properly encoded (#16553)."
gethostbyname.return_value = '191.252.51.69' gethostbyname.return_value = '194.27.42.76'
g = GeoIP2() g = GeoIP2()
d = g.city('www.fasano.com.br') d = g.city('nigde.edu.tr')
self.assertEqual(d['city'], 'São José dos Campos') self.assertEqual('Niğde', d['city'])
d = g.country('200.26.205.1') d = g.country('200.26.205.1')
# Some databases have only unaccented countries # Some databases have only unaccented countries
self.assertIn(d['country_name'], ('Curaçao', 'Curacao')) self.assertIn(d['country_name'], ('Curaçao', 'Curacao'))