Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
8f90593e
Kaydet (Commit)
8f90593e
authored
Eki 24, 2018
tarafından
Tom Forbes
Kaydeden (comit)
Tim Graham
Eki 24, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed obsolete and flaky GeoIP tests.
üst
6a8b57df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
test_geoip2.py
tests/gis_tests/test_geoip2.py
+3
-17
No files found.
tests/gis_tests/test_geoip2.py
Dosyayı görüntüle @
8f90593e
...
@@ -127,26 +127,12 @@ class GeoIPTest(SimpleTestCase):
...
@@ -127,26 +127,12 @@ class GeoIPTest(SimpleTestCase):
self
.
assertEqual
(
'Houston'
,
d
[
'city'
])
self
.
assertEqual
(
'Houston'
,
d
[
'city'
])
self
.
assertEqual
(
'TX'
,
d
[
'region'
])
self
.
assertEqual
(
'TX'
,
d
[
'region'
])
self
.
assertEqual
(
'America/Chicago'
,
d
[
'time_zone'
])
self
.
assertEqual
(
'America/Chicago'
,
d
[
'time_zone'
])
geom
=
g
.
geos
(
query
)
geom
=
g
.
geos
(
query
)
self
.
assertIsInstance
(
geom
,
GEOSGeometry
)
self
.
assertIsInstance
(
geom
,
GEOSGeometry
)
lon
,
lat
=
(
-
95.4010
,
29.7079
)
lat_lon
=
g
.
lat_lon
(
query
)
lat_lon
=
(
lat_lon
[
1
],
lat_lon
[
0
])
for
tup
in
(
geom
.
tuple
,
g
.
coords
(
query
),
g
.
lon_lat
(
query
),
lat_lon
):
self
.
assertAlmostEqual
(
lon
,
tup
[
0
],
4
)
self
.
assertAlmostEqual
(
lat
,
tup
[
1
],
4
)
@mock.patch
(
'socket.gethostbyname'
)
for
e1
,
e2
in
(
geom
.
tuple
,
g
.
coords
(
query
),
g
.
lon_lat
(
query
),
g
.
lat_lon
(
query
)):
def
test05_unicode_response
(
self
,
gethostbyname
):
self
.
assertIsInstance
(
e1
,
float
)
"GeoIP strings should be properly encoded (#16553)."
self
.
assertIsInstance
(
e2
,
float
)
gethostbyname
.
return_value
=
'194.27.42.76'
g
=
GeoIP2
()
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'
))
def
test06_ipv6_query
(
self
):
def
test06_ipv6_query
(
self
):
"GeoIP can lookup IPv6 addresses."
"GeoIP can lookup IPv6 addresses."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment