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
f24eea3b
Kaydet (Commit)
f24eea3b
authored
Kas 30, 2016
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Kas 30, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplified union GIS tests with equals() rather than equals_exact().
üst
21322f92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
test_functions.py
tests/gis_tests/geoapp/test_functions.py
+2
-5
tests.py
tests/gis_tests/geoapp/tests.py
+3
-5
No files found.
tests/gis_tests/geoapp/test_functions.py
Dosyayı görüntüle @
f24eea3b
...
...
@@ -485,8 +485,5 @@ class GISFunctionsTests(TestCase):
def
test_union
(
self
):
geom
=
Point
(
-
95.363151
,
29.763374
,
srid
=
4326
)
ptown
=
City
.
objects
.
annotate
(
union
=
functions
.
Union
(
'point'
,
geom
))
.
get
(
name
=
'Dallas'
)
tol
=
0.00001
# Undefined ordering
expected1
=
fromstr
(
'MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)'
,
srid
=
4326
)
expected2
=
fromstr
(
'MULTIPOINT(-95.363151 29.763374,-96.801611 32.782057)'
,
srid
=
4326
)
self
.
assertTrue
(
expected1
.
equals_exact
(
ptown
.
union
,
tol
)
or
expected2
.
equals_exact
(
ptown
.
union
,
tol
))
expected
=
fromstr
(
'MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)'
,
srid
=
4326
)
self
.
assertTrue
(
expected
.
equals
(
ptown
.
union
))
tests/gis_tests/geoapp/tests.py
Dosyayı görüntüle @
f24eea3b
...
...
@@ -858,8 +858,7 @@ class GeoQuerySetTest(TestCase):
"""
tx
=
Country
.
objects
.
get
(
name
=
'Texas'
)
.
mpoly
# Houston, Dallas -- Ordering may differ depending on backend or GEOS version.
union1
=
fromstr
(
'MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)'
)
union2
=
fromstr
(
'MULTIPOINT(-95.363151 29.763374,-96.801611 32.782057)'
)
union
=
GEOSGeometry
(
'MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)'
)
qs
=
City
.
objects
.
filter
(
point__within
=
tx
)
with
self
.
assertRaises
(
ValueError
):
qs
.
aggregate
(
Union
(
'name'
))
...
...
@@ -868,9 +867,8 @@ class GeoQuerySetTest(TestCase):
# an aggregate method on a spatial column)
u1
=
qs
.
aggregate
(
Union
(
'point'
))[
'point__union'
]
u2
=
qs
.
order_by
(
'name'
)
.
aggregate
(
Union
(
'point'
))[
'point__union'
]
tol
=
0.00001
self
.
assertTrue
(
union1
.
equals_exact
(
u1
,
tol
)
or
union2
.
equals_exact
(
u1
,
tol
))
self
.
assertTrue
(
union1
.
equals_exact
(
u2
,
tol
)
or
union2
.
equals_exact
(
u2
,
tol
))
self
.
assertTrue
(
union
.
equals
(
u1
))
self
.
assertTrue
(
union
.
equals
(
u2
))
qs
=
City
.
objects
.
filter
(
name
=
'NotACity'
)
self
.
assertIsNone
(
qs
.
aggregate
(
Union
(
'point'
))[
'point__union'
])
...
...
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