parent
efe9874371
commit
70b7d6b4ea
|
@ -40,14 +40,14 @@ class SpatialRefSysMixin(object):
|
||||||
try:
|
try:
|
||||||
self._srs = gdal.SpatialReference(self.wkt)
|
self._srs = gdal.SpatialReference(self.wkt)
|
||||||
return self.srs
|
return self.srs
|
||||||
except Exception as msg:
|
except Exception as e:
|
||||||
pass
|
msg = e
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._srs = gdal.SpatialReference(self.proj4text)
|
self._srs = gdal.SpatialReference(self.proj4text)
|
||||||
return self.srs
|
return self.srs
|
||||||
except Exception as msg:
|
except Exception as e:
|
||||||
pass
|
msg = e
|
||||||
|
|
||||||
raise Exception('Could not get OSR SpatialReference from WKT: %s\nError:\n%s' % (self.wkt, msg))
|
raise Exception('Could not get OSR SpatialReference from WKT: %s\nError:\n%s' % (self.wkt, msg))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -213,7 +213,7 @@ class Command(BaseCommand):
|
||||||
model_keys.append(model_key)
|
model_keys.append(model_key)
|
||||||
post_migrate_apps.unregister_model(*model_key)
|
post_migrate_apps.unregister_model(*model_key)
|
||||||
post_migrate_apps.render_multiple([
|
post_migrate_apps.render_multiple([
|
||||||
ModelState.from_model(apps.get_model(*model_key)) for model_key in model_keys
|
ModelState.from_model(apps.get_model(*model)) for model in model_keys
|
||||||
])
|
])
|
||||||
|
|
||||||
# Send the post_migrate signal, so individual apps can do whatever they need
|
# Send the post_migrate signal, so individual apps can do whatever they need
|
||||||
|
|
|
@ -3,7 +3,11 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
from ..fields import * # NOQA
|
from ..fields import (
|
||||||
|
ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField,
|
||||||
|
FloatRangeField, HStoreField, IntegerRangeField, JSONField,
|
||||||
|
SearchVectorField,
|
||||||
|
)
|
||||||
from ..models import TagField
|
from ..models import TagField
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -104,12 +104,9 @@ class LiveServerViews(LiveServerBase):
|
||||||
Ensure that the LiveServerTestCase serves 404s.
|
Ensure that the LiveServerTestCase serves 404s.
|
||||||
Refs #2879.
|
Refs #2879.
|
||||||
"""
|
"""
|
||||||
try:
|
with self.assertRaises(HTTPError) as err:
|
||||||
self.urlopen('/')
|
self.urlopen('/')
|
||||||
except HTTPError as err:
|
self.assertEqual(err.exception.code, 404, 'Expected 404 response')
|
||||||
self.assertEqual(err.code, 404, 'Expected 404 response')
|
|
||||||
else:
|
|
||||||
self.fail('Expected 404 response')
|
|
||||||
|
|
||||||
def test_view(self):
|
def test_view(self):
|
||||||
"""
|
"""
|
||||||
|
@ -133,12 +130,9 @@ class LiveServerViews(LiveServerBase):
|
||||||
tries to access a static file that isn't explicitly put under
|
tries to access a static file that isn't explicitly put under
|
||||||
STATIC_ROOT.
|
STATIC_ROOT.
|
||||||
"""
|
"""
|
||||||
try:
|
with self.assertRaises(HTTPError) as err:
|
||||||
self.urlopen('/static/another_app/another_app_static_file.txt')
|
self.urlopen('/static/another_app/another_app_static_file.txt')
|
||||||
except HTTPError as err:
|
self.assertEqual(err.exception.code, 404, 'Expected 404 response')
|
||||||
self.assertEqual(err.code, 404, 'Expected 404 response')
|
|
||||||
else:
|
|
||||||
self.fail('Expected 404 response (got %d)' % err.code)
|
|
||||||
|
|
||||||
def test_media_files(self):
|
def test_media_files(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue