diff --git a/tests/gis_tests/test_geoip2.py b/tests/gis_tests/test_geoip2.py
index 290fb35..2026fb9 100644
a
|
b
|
from unittest import skipUnless
|
8 | 8 | from django.conf import settings |
9 | 9 | from django.contrib.gis.geoip2 import HAS_GEOIP2 |
10 | 10 | from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry |
| 11 | from django.test import mock |
11 | 12 | from django.utils import six |
12 | 13 | |
13 | 14 | if HAS_GEOIP2: |
… |
… |
class GeoIPTest(unittest.TestCase):
|
121 | 122 | self.assertAlmostEqual(lon, tup[0], 4) |
122 | 123 | self.assertAlmostEqual(lat, tup[1], 4) |
123 | 124 | |
124 | | def test05_unicode_response(self): |
| 125 | @mock.patch('socket.gethostbyname') |
| 126 | def test05_unicode_response(self, gethostbyname): |
125 | 127 | "GeoIP strings should be properly encoded (#16553)." |
| 128 | gethostbyname.return_value = '194.27.42.76' |
126 | 129 | g = GeoIP2() |
127 | 130 | d = g.city("nigde.edu.tr") |
128 | 131 | self.assertEqual('Niğde', d['city']) |