mirror of
https://github.com/django/django.git
synced 2025-07-22 10:39:13 +00:00
[1.11.x] Fixed a GeoIP2 test failure with the latest GeoIP2 database.
Backport of 66d74676e23c32bc676fb0706af8580b391953b6 from master
This commit is contained in:
parent
1bf0e5c43c
commit
967d824288
@ -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 = '194.27.42.76'
|
||||
gethostbyname.return_value = '191.252.51.69'
|
||||
g = GeoIP2()
|
||||
d = g.city("nigde.edu.tr")
|
||||
self.assertEqual('Niğde', d['city'])
|
||||
d = g.city('www.fasano.com.br')
|
||||
self.assertEqual(d['city'], 'São José dos Campos')
|
||||
d = g.country('200.26.205.1')
|
||||
# Some databases have only unaccented countries
|
||||
self.assertIn(d['country_name'], ('Curaçao', 'Curacao'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user