Fixed E221 pep8 warnings.

This commit is contained in:
Tim Graham 2013-10-22 09:31:43 -04:00
parent 0d0f4f020a
commit 1597503a01
30 changed files with 94 additions and 90 deletions

View File

@ -204,7 +204,13 @@ def model_detail(request, app_label, model_name):
if isinstance(field, models.ForeignKey):
data_type = field.rel.to.__name__
app_label = field.rel.to._meta.app_label
verbose = utils.parse_rst((_("the related `%(app_label)s.%(data_type)s` object") % {'app_label': app_label, 'data_type': data_type}), 'model', _('model:') + data_type)
verbose = utils.parse_rst(
(_("the related `%(app_label)s.%(data_type)s` object") % {
'app_label': app_label, 'data_type': data_type,
}),
'model',
_('model:') + data_type,
)
else:
data_type = get_readable_field_data_type(field)
verbose = field.verbose_name

View File

@ -275,7 +275,6 @@ class TestUtilsHashPass(unittest.TestCase):
finally:
hasher.iterations = old_iterations
def test_load_library_no_algorithm(self):
with self.assertRaises(ValueError) as e:
BasePasswordHasher()._load_library()

View File

@ -500,7 +500,7 @@ class ImmutableList(tuple):
extend = complain
insert = complain
pop = complain
remove = complain
remove= complain
sort = complain
reverse = complain

View File

@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
[flake8]
exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py
ignore=E124,E125,E127,E128,E225,E226,E241,E251,E302,E501,E203,E221,E231,E261,E301,F401,F403,W601
ignore=E124,E125,E127,E128,E225,E226,E241,E251,E302,E501,E203,E231,E261,E301,F401,F403,W601
[metadata]
license-file = LICENSE

View File

@ -22,7 +22,6 @@ from .models import Article, Count, Event, Location, EventGuide
class NestedObjectsTests(TestCase):
"""
Tests for ``NestedObject`` utility collection.
"""
def setUp(self):
self.n = NestedObjects(using=DEFAULT_DB_ALIAS)

View File

@ -1190,16 +1190,16 @@ class LocaleMiddlewareTests(TransRealMixin, TestCase):
# Clear the session data before request
session.save()
response = self.client.get('/en/simple/')
self.client.get('/en/simple/')
self.assertEqual(self.client.session['_language'], 'en')
# Clear the session data before request
session.save()
response = self.client.get('/fr/simple/')
self.client.get('/fr/simple/')
self.assertEqual(self.client.session['_language'], 'fr')
# Check that language is not changed in session
response = self.client.get('/en/simple/')
self.client.get('/en/simple/')
self.assertEqual(self.client.session['_language'], 'fr')
@override_settings(
@ -1221,7 +1221,7 @@ class LocaleMiddlewareTests(TransRealMixin, TestCase):
self.client.cookies[settings.SESSION_COOKIE_NAME] = session.session_key
# request other language; should default to old language key value
response = self.client.get('/fr/simple/')
self.client.get('/fr/simple/')
self.assertEqual(self.client.session['_language'], 'en')