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
6b6d13bf
Kaydet (Commit)
6b6d13bf
authored
Nis 04, 2015
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Stopped conditional discovery of gis_tests apps
Refs #23879.
üst
8097e548
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
83 additions
and
21 deletions
+83
-21
admin.py
tests/gis_tests/admin.py
+6
-0
models.py
tests/gis_tests/distapp/models.py
+2
-1
models.py
tests/gis_tests/geo3d/models.py
+4
-1
tests.py
tests/gis_tests/geo3d/tests.py
+2
-2
models.py
tests/gis_tests/geoadmin/models.py
+4
-2
models.py
tests/gis_tests/geoapp/models.py
+12
-1
models.py
tests/gis_tests/geogapp/models.py
+5
-1
0001_initial.py
tests/gis_tests/gis_migrations/migrations/0001_initial.py
+6
-3
models.py
tests/gis_tests/inspectapp/models.py
+7
-1
models.py
tests/gis_tests/layermap/models.py
+8
-1
tests.py
tests/gis_tests/layermap/tests.py
+2
-1
models.py
tests/gis_tests/models.py
+18
-0
models.py
tests/gis_tests/relatedapp/models.py
+3
-1
test_geoforms.py
tests/gis_tests/test_geoforms.py
+2
-1
runtests.py
tests/runtests.py
+2
-5
No files found.
tests/gis_tests/admin.py
0 → 100644
Dosyayı görüntüle @
6b6d13bf
try
:
from
django.contrib.gis
import
admin
except
ImportError
:
from
django.contrib
import
admin
admin
.
OSMGeoAdmin
=
admin
.
ModelAdmin
tests/gis_tests/distapp/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
..models
import
models
from
..utils
import
gisfield_may_be_null
...
...
@@ -12,6 +12,7 @@ class NamedModel(models.Model):
class
Meta
:
abstract
=
True
required_db_features
=
[
'gis_enabled'
]
def
__str__
(
self
):
return
self
.
name
...
...
tests/gis_tests/geo3d/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
..models
import
models
@python_2_unicode_compatible
class
NamedModel
(
models
.
Model
):
...
...
@@ -10,6 +11,7 @@ class NamedModel(models.Model):
class
Meta
:
abstract
=
True
required_db_features
=
[
'gis_enabled'
]
def
__str__
(
self
):
return
self
.
name
...
...
@@ -49,6 +51,7 @@ class SimpleModel(models.Model):
class
Meta
:
abstract
=
True
required_db_features
=
[
'gis_enabled'
]
class
Point2D
(
SimpleModel
):
...
...
tests/gis_tests/geo3d/tests.py
Dosyayı görüntüle @
6b6d13bf
...
...
@@ -17,8 +17,8 @@ if HAS_GEOS:
from
.models
import
(
City3D
,
Interstate2D
,
Interstate3D
,
InterstateProj2D
,
InterstateProj3D
,
Point2D
,
Point3D
,
MultiPoint3D
,
Polygon2D
,
Polygon3D
)
if
HAS_GDAL
:
from
django.contrib.gis.utils
import
LayerMapping
,
LayerMapError
if
HAS_GDAL
:
from
django.contrib.gis.utils
import
LayerMapping
,
LayerMapError
data_path
=
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
upath
(
__file__
)),
'..'
,
'data'
))
...
...
tests/gis_tests/geoadmin/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis
import
admin
from
django.contrib.gis.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
..admin
import
admin
from
..models
import
models
@python_2_unicode_compatible
class
City
(
models
.
Model
):
...
...
@@ -12,6 +13,7 @@ class City(models.Model):
class
Meta
:
app_label
=
'geoadmin'
required_db_features
=
[
'gis_enabled'
]
def
__str__
(
self
):
return
self
.
name
...
...
tests/gis_tests/geoapp/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
..models
import
models
from
..utils
import
gisfield_may_be_null
...
...
@@ -12,6 +12,7 @@ class NamedModel(models.Model):
class
Meta
:
abstract
=
True
required_db_features
=
[
'gis_enabled'
]
def
__str__
(
self
):
return
self
.
name
...
...
@@ -26,6 +27,7 @@ class City(NamedModel):
class
Meta
:
app_label
=
'geoapp'
required_db_features
=
[
'gis_enabled'
]
# This is an inherited model from City
...
...
@@ -39,6 +41,7 @@ class PennsylvaniaCity(City):
class
Meta
:
app_label
=
'geoapp'
required_db_features
=
[
'gis_enabled'
]
class
State
(
NamedModel
):
...
...
@@ -46,6 +49,7 @@ class State(NamedModel):
class
Meta
:
app_label
=
'geoapp'
required_db_features
=
[
'gis_enabled'
]
class
Track
(
NamedModel
):
...
...
@@ -59,6 +63,7 @@ class MultiFields(NamedModel):
class
Meta
:
unique_together
=
(
'city'
,
'point'
)
required_db_features
=
[
'gis_enabled'
]
class
Truth
(
models
.
Model
):
...
...
@@ -66,6 +71,9 @@ class Truth(models.Model):
objects
=
models
.
GeoManager
()
class
Meta
:
required_db_features
=
[
'gis_enabled'
]
class
Feature
(
NamedModel
):
geom
=
models
.
GeometryField
()
...
...
@@ -76,6 +84,9 @@ class MinusOneSRID(models.Model):
objects
=
models
.
GeoManager
()
class
Meta
:
required_db_features
=
[
'gis_enabled'
]
class
NonConcreteField
(
models
.
IntegerField
):
...
...
tests/gis_tests/geogapp/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
..models
import
models
@python_2_unicode_compatible
class
NamedModel
(
models
.
Model
):
...
...
@@ -10,6 +11,7 @@ class NamedModel(models.Model):
class
Meta
:
abstract
=
True
required_db_features
=
[
'gis_enabled'
]
def
__str__
(
self
):
return
self
.
name
...
...
@@ -20,6 +22,7 @@ class City(NamedModel):
class
Meta
:
app_label
=
'geogapp'
required_db_features
=
[
'gis_enabled'
]
class
Zipcode
(
NamedModel
):
...
...
@@ -33,6 +36,7 @@ class County(NamedModel):
class
Meta
:
app_label
=
'geogapp'
required_db_features
=
[
'gis_enabled'
]
def
__str__
(
self
):
return
' County, '
.
join
([
self
.
name
,
self
.
state
])
tests/gis_tests/gis_migrations/migrations/0001_initial.py
Dosyayı görüntüle @
6b6d13bf
import
django.contrib.gis.db.models.fields
from
django.db
import
migrations
,
models
from
...models
import
models
as
gis_models
class
Migration
(
migrations
.
Migration
):
"""
...
...
@@ -12,9 +13,10 @@ class Migration(migrations.Migration):
fields
=
[
(
'id'
,
models
.
AutoField
(
verbose_name
=
'ID'
,
serialize
=
False
,
auto_created
=
True
,
primary_key
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
100
,
unique
=
True
)),
(
'geom'
,
django
.
contrib
.
gis
.
db
.
models
.
field
s
.
MultiPolygonField
(
srid
=
4326
)),
(
'geom'
,
gis_model
s
.
MultiPolygonField
(
srid
=
4326
)),
],
options
=
{
'required_db_features'
:
[
'gis_enabled'
],
},
bases
=
(
models
.
Model
,),
),
...
...
@@ -25,9 +27,10 @@ class Migration(migrations.Migration):
(
'neighborhood'
,
models
.
ForeignKey
(
to
=
'gis_migrations.Neighborhood'
,
to_field
=
'id'
,
null
=
True
)),
(
'address'
,
models
.
CharField
(
max_length
=
100
)),
(
'zip_code'
,
models
.
IntegerField
(
null
=
True
,
blank
=
True
)),
(
'geom'
,
django
.
contrib
.
gis
.
db
.
models
.
field
s
.
PointField
(
srid
=
4326
,
geography
=
True
)),
(
'geom'
,
gis_model
s
.
PointField
(
srid
=
4326
,
geography
=
True
)),
],
options
=
{
'required_db_features'
:
[
'gis_enabled'
],
},
bases
=
(
models
.
Model
,),
),
...
...
tests/gis_tests/inspectapp/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis.db
import
models
from
..models
import
models
class
AllOGRFields
(
models
.
Model
):
...
...
@@ -15,6 +15,9 @@ class AllOGRFields(models.Model):
objects
=
models
.
GeoManager
()
class
Meta
:
required_db_features
=
[
'gis_enabled'
]
class
Fields3D
(
models
.
Model
):
point
=
models
.
PointField
(
dim
=
3
)
...
...
@@ -22,3 +25,6 @@ class Fields3D(models.Model):
poly
=
models
.
PolygonField
(
dim
=
3
)
objects
=
models
.
GeoManager
()
class
Meta
:
required_db_features
=
[
'gis_enabled'
]
tests/gis_tests/layermap/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
..models
import
models
@python_2_unicode_compatible
class
NamedModel
(
models
.
Model
):
...
...
@@ -10,6 +11,7 @@ class NamedModel(models.Model):
class
Meta
:
abstract
=
True
required_db_features
=
[
'gis_enabled'
]
def
__str__
(
self
):
return
self
.
name
...
...
@@ -38,6 +40,7 @@ class City(NamedModel):
class
Meta
:
app_label
=
'layermap'
required_db_features
=
[
'gis_enabled'
]
class
Interstate
(
NamedModel
):
...
...
@@ -46,6 +49,7 @@ class Interstate(NamedModel):
class
Meta
:
app_label
=
'layermap'
required_db_features
=
[
'gis_enabled'
]
# Same as `City` above, but for testing model inheritance.
...
...
@@ -72,6 +76,9 @@ class ICity2(ICity1):
class
Invalid
(
models
.
Model
):
point
=
models
.
PointField
()
class
Meta
:
required_db_features
=
[
'gis_enabled'
]
# Mapping dictionaries for the models above.
co_mapping
=
{
...
...
tests/gis_tests/layermap/tests.py
Dosyayı görüntüle @
6b6d13bf
...
...
@@ -9,11 +9,12 @@ from unittest import skipUnless
from
django.conf
import
settings
from
django.contrib.gis.gdal
import
HAS_GDAL
from
django.contrib.gis.geos
import
HAS_GEOS
from
django.db
import
connection
from
django.test
import
TestCase
,
override_settings
,
skipUnlessDBFeature
from
django.utils._os
import
upath
if
HAS_GDAL
:
if
HAS_G
EOS
and
HAS_G
DAL
:
from
django.contrib.gis.utils.layermapping
import
(
LayerMapping
,
LayerMapError
,
InvalidDecimal
,
InvalidString
,
MissingForeignKey
)
from
django.contrib.gis.gdal
import
DataSource
...
...
tests/gis_tests/models.py
0 → 100644
Dosyayı görüntüle @
6b6d13bf
from
django.core.exceptions
import
ImproperlyConfigured
try
:
from
django.contrib.gis.db
import
models
except
ImproperlyConfigured
:
from
django.db
import
models
class
DummyField
(
models
.
Field
):
def
__init__
(
self
,
dim
=
None
,
srid
=
None
,
geography
=
None
,
*
args
,
**
kwargs
):
super
(
DummyField
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
models
.
GeoManager
=
models
.
Manager
models
.
GeometryField
=
DummyField
models
.
LineStringField
=
DummyField
models
.
MultiPointField
=
DummyField
models
.
MultiPolygonField
=
DummyField
models
.
PointField
=
DummyField
models
.
PolygonField
=
DummyField
tests/gis_tests/relatedapp/models.py
Dosyayı görüntüle @
6b6d13bf
from
django.contrib.gis.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
..models
import
models
class
SimpleModel
(
models
.
Model
):
...
...
@@ -8,6 +9,7 @@ class SimpleModel(models.Model):
class
Meta
:
abstract
=
True
required_db_features
=
[
'gis_enabled'
]
@python_2_unicode_compatible
...
...
tests/gis_tests/test_geoforms.py
Dosyayı görüntüle @
6b6d13bf
from
unittest
import
skipUnless
from
django.contrib.gis.gdal
import
HAS_GDAL
from
django.contrib.gis.geos
import
HAS_GEOS
from
django.forms
import
ValidationError
from
django.test
import
SimpleTestCase
,
skipUnlessDBFeature
from
django.utils
import
six
from
django.utils.html
import
escape
if
HAS_GDAL
:
if
HAS_G
EOS
and
HAS_G
DAL
:
from
django.contrib.gis
import
forms
from
django.contrib.gis.geos
import
GEOSGeometry
...
...
tests/runtests.py
Dosyayı görüntüle @
6b6d13bf
...
...
@@ -73,12 +73,9 @@ def get_test_modules():
modules
=
[]
discovery_paths
=
[
(
None
,
RUNTESTS_DIR
),
# GIS tests are in nested apps
(
'gis_tests'
,
os
.
path
.
join
(
RUNTESTS_DIR
,
'gis_tests'
)),
]
# GIS tests are in nested apps
if
connection
.
features
.
gis_enabled
:
discovery_paths
.
append
(
(
'gis_tests'
,
os
.
path
.
join
(
RUNTESTS_DIR
,
'gis_tests'
))
)
for
modpath
,
dirpath
in
discovery_paths
:
for
f
in
os
.
listdir
(
dirpath
):
...
...
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