Fixed flake8 2.6 warnings.
This commit is contained in:
parent
96f97691ad
commit
ea34426ae7
|
@ -40,14 +40,14 @@ class SpatialRefSysMixin(object):
|
|||
try:
|
||||
self._srs = gdal.SpatialReference(self.wkt)
|
||||
return self.srs
|
||||
except Exception as msg:
|
||||
pass
|
||||
except Exception as e:
|
||||
msg = e
|
||||
|
||||
try:
|
||||
self._srs = gdal.SpatialReference(self.proj4text)
|
||||
return self.srs
|
||||
except Exception as msg:
|
||||
pass
|
||||
except Exception as e:
|
||||
msg = e
|
||||
|
||||
raise Exception('Could not get OSR SpatialReference from WKT: %s\nError:\n%s' % (self.wkt, msg))
|
||||
else:
|
||||
|
|
|
@ -213,7 +213,7 @@ class Command(BaseCommand):
|
|||
model_keys.append(model_key)
|
||||
post_migrate_apps.unregister_model(*model_key)
|
||||
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
|
||||
|
|
|
@ -3,7 +3,11 @@ from __future__ import unicode_literals
|
|||
|
||||
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
|
||||
|
||||
|
||||
|
|
|
@ -104,12 +104,9 @@ class LiveServerViews(LiveServerBase):
|
|||
Ensure that the LiveServerTestCase serves 404s.
|
||||
Refs #2879.
|
||||
"""
|
||||
try:
|
||||
with self.assertRaises(HTTPError) as err:
|
||||
self.urlopen('/')
|
||||
except HTTPError as err:
|
||||
self.assertEqual(err.code, 404, 'Expected 404 response')
|
||||
else:
|
||||
self.fail('Expected 404 response')
|
||||
self.assertEqual(err.exception.code, 404, 'Expected 404 response')
|
||||
|
||||
def test_view(self):
|
||||
"""
|
||||
|
@ -133,12 +130,9 @@ class LiveServerViews(LiveServerBase):
|
|||
tries to access a static file that isn't explicitly put under
|
||||
STATIC_ROOT.
|
||||
"""
|
||||
try:
|
||||
with self.assertRaises(HTTPError) as err:
|
||||
self.urlopen('/static/another_app/another_app_static_file.txt')
|
||||
except HTTPError as err:
|
||||
self.assertEqual(err.code, 404, 'Expected 404 response')
|
||||
else:
|
||||
self.fail('Expected 404 response (got %d)' % err.code)
|
||||
self.assertEqual(err.exception.code, 404, 'Expected 404 response')
|
||||
|
||||
def test_media_files(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue