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
5aa53286
Kaydet (Commit)
5aa53286
authored
Ock 28, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #26147 -- Relaxed expected values in GIS tests to account for database/library differences.
üst
e73fb2c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
tests.py
tests/gis_tests/distapp/tests.py
+2
-2
tests.py
tests/gis_tests/geogapp/tests.py
+10
-6
No files found.
tests/gis_tests/distapp/tests.py
Dosyayı görüntüle @
5aa53286
...
@@ -149,7 +149,7 @@ class DistanceTest(TestCase):
...
@@ -149,7 +149,7 @@ class DistanceTest(TestCase):
"""
"""
Test the `distance` GeoQuerySet method on geodetic coordinate systems.
Test the `distance` GeoQuerySet method on geodetic coordinate systems.
"""
"""
tol
=
2
if
oracle
else
5
tol
=
2
if
oracle
else
4
# Testing geodetic distance calculation with a non-point geometry
# Testing geodetic distance calculation with a non-point geometry
# (a LineString of Wollongong and Shellharbour coords).
# (a LineString of Wollongong and Shellharbour coords).
...
@@ -560,7 +560,7 @@ class DistanceFunctionsTests(TestCase):
...
@@ -560,7 +560,7 @@ class DistanceFunctionsTests(TestCase):
@skipUnlessDBFeature
(
"has_Distance_function"
,
"supports_distance_geodetic"
)
@skipUnlessDBFeature
(
"has_Distance_function"
,
"supports_distance_geodetic"
)
def
test_distance_geodetic_spheroid
(
self
):
def
test_distance_geodetic_spheroid
(
self
):
tol
=
2
if
oracle
else
5
tol
=
2
if
oracle
else
4
# Got the reference distances using the raw SQL statements:
# Got the reference distances using the raw SQL statements:
# SELECT ST_distance_spheroid(point, ST_GeomFromText('POINT(151.231341 -33.952685)', 4326),
# SELECT ST_distance_spheroid(point, ST_GeomFromText('POINT(151.231341 -33.952685)', 4326),
...
...
tests/gis_tests/geogapp/tests.py
Dosyayı görüntüle @
5aa53286
...
@@ -98,10 +98,12 @@ class GeographyTest(TestCase):
...
@@ -98,10 +98,12 @@ class GeographyTest(TestCase):
def
test06_geography_area
(
self
):
def
test06_geography_area
(
self
):
"Testing that Area calculations work on geography columns."
"Testing that Area calculations work on geography columns."
# SELECT ST_Area(poly) FROM geogapp_zipcode WHERE code='77002';
# SELECT ST_Area(poly) FROM geogapp_zipcode WHERE code='77002';
ref_area
=
5439100.13586914
if
oracle
else
5439084.70637573
tol
=
5
z
=
Zipcode
.
objects
.
area
()
.
get
(
code
=
'77002'
)
z
=
Zipcode
.
objects
.
area
()
.
get
(
code
=
'77002'
)
self
.
assertAlmostEqual
(
z
.
area
.
sq_m
,
ref_area
,
tol
)
# Round to the nearest thousand as possible values (depending on
# the database and geolib) include 5439084, 5439100, 5439101.
rounded_value
=
z
.
area
.
sq_m
rounded_value
-=
z
.
area
.
sq_m
%
1000
self
.
assertEqual
(
rounded_value
,
5439000
)
@skipUnlessDBFeature
(
"gis_enabled"
)
@skipUnlessDBFeature
(
"gis_enabled"
)
...
@@ -128,7 +130,9 @@ class GeographyFunctionTests(TestCase):
...
@@ -128,7 +130,9 @@ class GeographyFunctionTests(TestCase):
Testing that Area calculations work on geography columns.
Testing that Area calculations work on geography columns.
"""
"""
# SELECT ST_Area(poly) FROM geogapp_zipcode WHERE code='77002';
# SELECT ST_Area(poly) FROM geogapp_zipcode WHERE code='77002';
ref_area
=
5439100.13587
if
oracle
else
5439084.70637573
tol
=
5
z
=
Zipcode
.
objects
.
annotate
(
area
=
Area
(
'poly'
))
.
get
(
code
=
'77002'
)
z
=
Zipcode
.
objects
.
annotate
(
area
=
Area
(
'poly'
))
.
get
(
code
=
'77002'
)
self
.
assertAlmostEqual
(
z
.
area
.
sq_m
,
ref_area
,
tol
)
# Round to the nearest thousand as possible values (depending on
# the database and geolib) include 5439084, 5439100, 5439101.
rounded_value
=
z
.
area
.
sq_m
rounded_value
-=
z
.
area
.
sq_m
%
1000
self
.
assertEqual
(
rounded_value
,
5439000
)
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