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
e7e39d32
Kaydet (Commit)
e7e39d32
authored
May 05, 2015
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Made some tests run on non-GIS databases
üst
72f6513e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
tests.py
tests/gis_tests/inspectapp/tests.py
+10
-2
No files found.
tests/gis_tests/inspectapp/tests.py
Dosyayı görüntüle @
e7e39d32
...
...
@@ -8,6 +8,7 @@ from django.contrib.gis.gdal import HAS_GDAL
from
django.core.management
import
call_command
from
django.db
import
connection
,
connections
from
django.test
import
TestCase
,
skipUnlessDBFeature
from
django.test.utils
import
modify_settings
from
django.utils.six
import
StringIO
from
..test_data
import
TEST_DATA
...
...
@@ -20,8 +21,8 @@ if HAS_GDAL:
@skipUnless
(
HAS_GDAL
,
"InspectDbTests needs GDAL support"
)
@skipUnlessDBFeature
(
"gis_enabled"
)
class
InspectDbTests
(
TestCase
):
@skipUnlessDBFeature
(
"gis_enabled"
)
def
test_geom_columns
(
self
):
"""
Test the geo-enabled inspectdb command.
...
...
@@ -62,7 +63,9 @@ class InspectDbTests(TestCase):
@skipUnless
(
HAS_GDAL
,
"OGRInspectTest needs GDAL support"
)
@skipUnlessDBFeature
(
"gis_enabled"
)
@modify_settings
(
INSTALLED_APPS
=
{
'append'
:
'django.contrib.gis'
},
)
class
OGRInspectTest
(
TestCase
):
maxDiff
=
1024
...
...
@@ -84,6 +87,11 @@ class OGRInspectTest(TestCase):
self
.
assertEqual
(
model_def
,
'
\n
'
.
join
(
expected
))
def
test_poly_multi
(
self
):
shp_file
=
os
.
path
.
join
(
TEST_DATA
,
'test_poly'
,
'test_poly.shp'
)
model_def
=
ogrinspect
(
shp_file
,
'MyModel'
,
multi_geom
=
True
)
self
.
assertIn
(
'geom = models.MultiPolygonField(srid=-1)'
,
model_def
)
def
test_date_field
(
self
):
shp_file
=
os
.
path
.
join
(
TEST_DATA
,
'cities'
,
'cities.shp'
)
model_def
=
ogrinspect
(
shp_file
,
'City'
)
...
...
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