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
17a9e0cd
Kaydet (Commit)
17a9e0cd
authored
Ara 17, 2016
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Ara 17, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Used assertJSONEqual() in GISFunctionsTests.test_asgeojson().
üst
5d28fef8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
test_functions.py
tests/gis_tests/geoapp/test_functions.py
+4
-9
No files found.
tests/gis_tests/geoapp/test_functions.py
Dosyayı görüntüle @
17a9e0cd
...
...
@@ -46,11 +46,6 @@ class GISFunctionsTests(TestCase):
'{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},'
'"bbox":[-87.65018,41.85039,-87.65018,41.85039],"coordinates":[-87.65018,41.85039]}'
)
if
spatialite
:
victoria_json
=
(
'{"type":"Point","bbox":[-123.305196,48.462611,-123.305196,48.462611],'
'"coordinates":[-123.305196,48.462611]}'
)
# Precision argument should only be an integer
with
self
.
assertRaises
(
TypeError
):
...
...
@@ -59,7 +54,7 @@ class GISFunctionsTests(TestCase):
# Reference queries and values.
# SELECT ST_AsGeoJson("geoapp_city"."point", 8, 0)
# FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Pueblo';
self
.
assertEqual
(
self
.
assert
JSON
Equal
(
pueblo_json
,
City
.
objects
.
annotate
(
geojson
=
functions
.
AsGeoJSON
(
'point'
))
.
get
(
name
=
'Pueblo'
)
.
geojson
)
...
...
@@ -67,7 +62,7 @@ class GISFunctionsTests(TestCase):
# SELECT ST_AsGeoJson("geoapp_city"."point", 8, 2) FROM "geoapp_city"
# WHERE "geoapp_city"."name" = 'Houston';
# This time we want to include the CRS by using the `crs` keyword.
self
.
assertEqual
(
self
.
assert
JSON
Equal
(
houston_json
,
City
.
objects
.
annotate
(
json
=
functions
.
AsGeoJSON
(
'point'
,
crs
=
True
))
.
get
(
name
=
'Houston'
)
.
json
)
...
...
@@ -75,7 +70,7 @@ class GISFunctionsTests(TestCase):
# SELECT ST_AsGeoJson("geoapp_city"."point", 8, 1) FROM "geoapp_city"
# WHERE "geoapp_city"."name" = 'Houston';
# This time we include the bounding box by using the `bbox` keyword.
self
.
assertEqual
(
self
.
assert
JSON
Equal
(
victoria_json
,
City
.
objects
.
annotate
(
geojson
=
functions
.
AsGeoJSON
(
'point'
,
bbox
=
True
)
...
...
@@ -85,7 +80,7 @@ class GISFunctionsTests(TestCase):
# SELECT ST_AsGeoJson("geoapp_city"."point", 5, 3) FROM "geoapp_city"
# WHERE "geoapp_city"."name" = 'Chicago';
# Finally, we set every available keyword.
self
.
assertEqual
(
self
.
assert
JSON
Equal
(
chicago_json
,
City
.
objects
.
annotate
(
geojson
=
functions
.
AsGeoJSON
(
'point'
,
bbox
=
True
,
crs
=
True
,
precision
=
5
)
...
...
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