Kaydet (Commit) 66d74676 authored tarafından Tim Graham's avatar Tim Graham

Fixed a GeoIP2 test failure with the latest GeoIP2 database.

üst d60e8b85
...@@ -134,10 +134,10 @@ class GeoIPTest(unittest.TestCase): ...@@ -134,10 +134,10 @@ class GeoIPTest(unittest.TestCase):
@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 = '194.27.42.76' gethostbyname.return_value = '191.252.51.69'
g = GeoIP2() g = GeoIP2()
d = g.city("nigde.edu.tr") d = g.city('www.fasano.com.br')
self.assertEqual('Niğde', d['city']) self.assertEqual(d['city'], 'São José dos Campos')
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'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment