Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed E125 pep8 warnings

  • Loading branch information...
commit 7477a4ffde4781f4e84503e66d7f775074089887 1 parent d1df395
Christopher Medrela authored timgraham committed
Showing with 67 additions and 67 deletions.
  1. +1 −1  django/contrib/admin/options.py
  2. +1 −1  django/contrib/admin/sites.py
  3. +1 −1  django/contrib/admin/validation.py
  4. +1 −1  django/contrib/auth/decorators.py
  5. +2 −2 django/contrib/flatpages/forms.py
  6. +1 −1  django/contrib/formtools/wizard/views.py
  7. +2 −2 django/contrib/gis/db/backends/postgis/operations.py
  8. +1 −1  django/contrib/gis/db/models/sql/where.py
  9. +1 −1  django/contrib/gis/models.py
  10. +1 −1  django/contrib/gis/utils/layermapping.py
  11. +1 −1  django/contrib/sessions/tests.py
  12. +1 −1  django/contrib/sitemaps/__init__.py
  13. +1 −1  django/db/backends/__init__.py
  14. +1 −1  django/db/backends/mysql/compiler.py
  15. +2 −2 django/db/models/deletion.py
  16. +1 −1  django/db/models/fields/__init__.py
  17. +2 −2 django/db/models/query.py
  18. +4 −4 django/db/models/sql/query.py
  19. +1 −1  django/db/models/sql/subqueries.py
  20. +2 −2 django/db/models/sql/where.py
  21. +2 −2 django/forms/fields.py
  22. +3 −3 django/forms/formsets.py
  23. +3 −3 django/forms/models.py
  24. +1 −1  django/http/request.py
  25. +1 −1  django/middleware/common.py
  26. +1 −1  django/template/defaultfilters.py
  27. +1 −1  django/template/loader_tags.py
  28. +1 −1  django/test/runner.py
  29. +4 −4 django/test/testcases.py
  30. +2 −2 django/utils/_os.py
  31. +3 −3 django/utils/feedgenerator.py
  32. +1 −1  django/utils/html.py
  33. +3 −3 django/views/debug.py
  34. +1 −1  django/views/generic/list.py
  35. +2 −2 extras/csrf_migration_helper.py
  36. +1 −1  tests/defer/tests.py
  37. +5 −5 tests/runtests.py
  38. +4 −4 tests/wsgi/tests.py
View
2  django/contrib/admin/options.py
@@ -613,7 +613,7 @@ def get_changelist_form(self, request, **kwargs):
}
defaults.update(kwargs)
if (defaults.get('fields') is None
- and not modelform_defines_fields(defaults.get('form'))):
+ and not modelform_defines_fields(defaults.get('form'))):
defaults['fields'] = forms.ALL_FIELDS
return modelform_factory(self.model, **defaults)
View
2  django/contrib/admin/sites.py
@@ -169,7 +169,7 @@ def check_dependencies(self):
raise ImproperlyConfigured("Put 'django.contrib.contenttypes' in "
"your INSTALLED_APPS setting in order to use the admin application.")
if not ('django.contrib.auth.context_processors.auth' in settings.TEMPLATE_CONTEXT_PROCESSORS or
- 'django.core.context_processors.auth' in settings.TEMPLATE_CONTEXT_PROCESSORS):
+ 'django.core.context_processors.auth' in settings.TEMPLATE_CONTEXT_PROCESSORS):
raise ImproperlyConfigured("Put 'django.contrib.auth.context_processors.auth' "
"in your TEMPLATE_CONTEXT_PROCESSORS setting in order to use the admin application.")
View
2  django/contrib/admin/validation.py
@@ -155,7 +155,7 @@ def validate_prepopulated_fields(self, cls, model):
for field, val in cls.prepopulated_fields.items():
f = get_field(cls, model, 'prepopulated_fields', field)
if isinstance(f, (models.DateTimeField, models.ForeignKey,
- models.ManyToManyField)):
+ models.ManyToManyField)):
raise ImproperlyConfigured("'%s.prepopulated_fields['%s']' "
"is either a DateTimeField, ForeignKey or "
"ManyToManyField. This isn't allowed."
View
2  django/contrib/auth/decorators.py
@@ -29,7 +29,7 @@ def _wrapped_view(request, *args, **kwargs):
login_scheme, login_netloc = urlparse(resolved_login_url)[:2]
current_scheme, current_netloc = urlparse(path)[:2]
if ((not login_scheme or login_scheme == current_scheme) and
- (not login_netloc or login_netloc == current_netloc)):
+ (not login_netloc or login_netloc == current_netloc)):
path = request.get_full_path()
from django.contrib.auth.views import redirect_to_login
return redirect_to_login(
View
4 django/contrib/flatpages/forms.py
@@ -23,8 +23,8 @@ def clean_url(self):
code='missing_leading_slash',
)
if (settings.APPEND_SLASH and
- 'django.middleware.common.CommonMiddleware' in settings.MIDDLEWARE_CLASSES and
- not url.endswith('/')):
+ 'django.middleware.common.CommonMiddleware' in settings.MIDDLEWARE_CLASSES and
+ not url.endswith('/')):
raise forms.ValidationError(
ugettext("URL is missing a trailing slash."),
code='missing_trailing_slash',
View
2  django/contrib/formtools/wizard/views.py
@@ -123,7 +123,7 @@ def as_view(cls, *args, **kwargs):
@classmethod
def get_initkwargs(cls, form_list=None, initial_dict=None,
- instance_dict=None, condition_dict=None, *args, **kwargs):
+ instance_dict=None, condition_dict=None, *args, **kwargs):
"""
Creates a dict with all needed parameters for the form wizard instances.
View
4 django/contrib/gis/db/backends/postgis/operations.py
@@ -369,7 +369,7 @@ def get_distance(self, f, dist_val, lookup_type):
dist_param = value
if (not geography and geodetic and lookup_type != 'dwithin'
- and option == 'spheroid'):
+ and option == 'spheroid'):
# using distance_spheroid requires the spheroid of the field as
# a parameter.
return [f._spheroid, dist_param]
@@ -467,7 +467,7 @@ def exactly_two(np):
def two_to_three(np):
return np >= 2 and np <= 3
if (lookup_type in self.distance_functions and
- lookup_type != 'dwithin'):
+ lookup_type != 'dwithin'):
return two_to_three(num_param)
else:
return exactly_two(num_param)
View
2  django/contrib/gis/db/models/sql/where.py
@@ -39,7 +39,7 @@ def _prepare_data(self, data):
if isinstance(data, (list, tuple)):
obj, lookup_type, value = data
if (isinstance(obj, Constraint) and
- isinstance(obj.field, GeometryField)):
+ isinstance(obj.field, GeometryField)):
data = (GeoConstraint(obj), lookup_type, value)
return super(GeoWhereNode, self)._prepare_data(data)
View
2  django/contrib/gis/models.py
@@ -1,7 +1,7 @@
from django.db import connection
if (hasattr(connection.ops, 'spatial_version') and
- not connection.ops.mysql):
+ not connection.ops.mysql):
# Getting the `SpatialRefSys` and `GeometryColumns`
# models for the default spatial backend. These
# aliases are provided for backwards-compatibility.
View
2  django/contrib/gis/utils/layermapping.py
@@ -339,7 +339,7 @@ def verify_ogr_field(self, ogr_field, model_field):
otherwise the proper exception is raised.
"""
if (isinstance(ogr_field, OFTString) and
- isinstance(model_field, (models.CharField, models.TextField))):
+ isinstance(model_field, (models.CharField, models.TextField))):
if self.encoding:
# The encoding for OGR data sources may be specified here
# (e.g., 'cp437' for Census Bureau boundary files).
View
2  django/contrib/sessions/tests.py
@@ -141,7 +141,7 @@ def test_clear(self):
def test_save(self):
if (hasattr(self.session, '_cache') and 'DummyCache' in
- settings.CACHES[settings.SESSION_CACHE_ALIAS]['BACKEND']):
+ settings.CACHES[settings.SESSION_CACHE_ALIAS]['BACKEND']):
raise unittest.SkipTest("Session saving tests require a real cache backend")
self.session.save()
self.assertTrue(self.session.exists(self.session.session_key))
View
2  django/contrib/sitemaps/__init__.py
@@ -94,7 +94,7 @@ def get_urls(self, page=1, site=None, protocol=None):
if all_items_lastmod:
all_items_lastmod = lastmod is not None
if (all_items_lastmod and
- (latest_lastmod is None or lastmod > latest_lastmod)):
+ (latest_lastmod is None or lastmod > latest_lastmod)):
latest_lastmod = lastmod
url_info = {
'item': item,
View
2  django/db/backends/__init__.py
@@ -153,7 +153,7 @@ def cursor(self):
"""
self.validate_thread_sharing()
if (self.use_debug_cursor or
- (self.use_debug_cursor is None and settings.DEBUG)):
+ (self.use_debug_cursor is None and settings.DEBUG)):
cursor = self.make_debug_cursor(self._cursor())
else:
cursor = utils.CursorWrapper(self._cursor(), self)
View
2  django/db/backends/mysql/compiler.py
@@ -8,7 +8,7 @@ def resolve_columns(self, row, fields=()):
index_extra_select = len(self.query.extra_select)
for value, field in zip_longest(row[index_extra_select:], fields):
if (field and field.get_internal_type() in ("BooleanField", "NullBooleanField") and
- value in (0, 1)):
+ value in (0, 1)):
value = bool(value)
values.append(value)
return row[:index_extra_select] + tuple(values)
View
4 django/db/models/deletion.py
@@ -135,7 +135,7 @@ def can_fast_delete(self, objs, from_field=None):
# Foreign keys pointing to this model, both from m2m and other
# models.
for related in opts.get_all_related_objects(
- include_hidden=True, include_proxy_eq=True):
+ include_hidden=True, include_proxy_eq=True):
if related.field.rel.on_delete is not DO_NOTHING:
return False
# GFK deletes
@@ -145,7 +145,7 @@ def can_fast_delete(self, objs, from_field=None):
return True
def collect(self, objs, source=None, nullable=False, collect_related=True,
- source_attr=None, reverse_dependency=False):
+ source_attr=None, reverse_dependency=False):
"""
Adds 'objs' to the collection of objects to be deleted as well as all
parent instances. 'objs' must be a homogenous iterable collection of
View
2  django/db/models/fields/__init__.py
@@ -1281,7 +1281,7 @@ def get_prep_value(self, value):
def get_prep_lookup(self, lookup_type, value):
if ((lookup_type == 'gte' or lookup_type == 'lt')
- and isinstance(value, float)):
+ and isinstance(value, float)):
value = math.ceil(value)
return super(IntegerField, self).get_prep_lookup(lookup_type, value)
View
4 django/db/models/query.py
@@ -392,7 +392,7 @@ def bulk_create(self, objs, batch_size=None):
fields = self.model._meta.local_fields
with transaction.commit_on_success_unless_managed(using=self.db):
if (connection.features.can_combine_inserts_with_and_without_auto_increment_pk
- and self.model._meta.has_auto_field):
+ and self.model._meta.has_auto_field):
self._batched_insert(objs, fields, batch_size)
else:
objs_with_pk, objs_without_pk = partition(lambda o: o.pk is None, objs)
@@ -1494,7 +1494,7 @@ class RawQuerySet(object):
annotated model instances.
"""
def __init__(self, raw_query, model=None, query=None, params=None,
- translations=None, using=None, hints=None):
+ translations=None, using=None, hints=None):
self.raw_query = raw_query
self.model = model
self._db = using
View
8 django/db/models/sql/query.py
@@ -994,9 +994,9 @@ def add_aggregate(self, aggregate, model, alias, is_summary):
raise FieldError("Cannot compute %s('%s'): '%s' is an aggregate" % (
aggregate.name, field_name, field_name))
elif ((len(field_list) > 1) or
- (field_list[0] not in [i.name for i in opts.fields]) or
- self.group_by is None or
- not is_summary):
+ (field_list[0] not in [i.name for i in opts.fields]) or
+ self.group_by is None or
+ not is_summary):
# If:
# - the field descriptor has more than one part (foo__bar), or
# - the field descriptor is referencing an m2m/m2o field, or
@@ -1906,7 +1906,7 @@ def is_nullable(self, field):
# is_nullable() is needed to the compiler stage, but that is not easy
# to do currently.
if ((connections[DEFAULT_DB_ALIAS].features.interprets_empty_strings_as_nulls)
- and field.empty_strings_allowed):
+ and field.empty_strings_allowed):
return True
else:
return field.null
View
2  django/db/models/sql/subqueries.py
@@ -61,7 +61,7 @@ def delete_qs(self, query, using):
innerq_used_tables = [t for t in innerq.tables
if innerq.alias_refcount[t]]
if ((not innerq_used_tables or innerq_used_tables == self.tables)
- and not len(innerq.having)):
+ and not len(innerq.having)):
# There is only the base table in use in the query, and there is
# no aggregate filtering going on.
self.where = innerq.where
View
4 django/db/models/sql/where.py
@@ -69,7 +69,7 @@ def _prepare_data(self, data):
# and empty values need special handling. Other types could be used
# here in the future (using Python types is suggested for consistency).
if (isinstance(value, datetime.datetime)
- or (isinstance(obj.field, DateTimeField) and lookup_type != 'isnull')):
+ or (isinstance(obj.field, DateTimeField) and lookup_type != 'isnull')):
value_annotation = datetime.datetime
elif hasattr(value, 'value_annotation'):
value_annotation = value.value_annotation
@@ -207,7 +207,7 @@ def make_atom(self, child, qn, connection):
params = field_params + params
if (len(params) == 1 and params[0] == '' and lookup_type == 'exact'
- and connection.features.interprets_empty_strings_as_nulls):
+ and connection.features.interprets_empty_strings_as_nulls):
lookup_type = 'isnull'
value_annotation = True
View
4 django/forms/fields.py
@@ -1102,8 +1102,8 @@ def __init__(self, path, match=None, recursive=False, allow_files=True,
continue
full_file = os.path.join(self.path, f)
if (((self.allow_files and os.path.isfile(full_file)) or
- (self.allow_folders and os.path.isdir(full_file))) and
- (self.match is None or self.match_re.search(f))):
+ (self.allow_folders and os.path.isdir(full_file))) and
+ (self.match is None or self.match_re.search(f))):
self.choices.append((full_file, f))
except OSError:
pass
View
6 django/forms/formsets.py
@@ -325,15 +325,15 @@ def full_clean(self):
self._errors.append(form.errors)
try:
if (self.validate_max and
- self.total_form_count() - len(self.deleted_forms) > self.max_num) or \
- self.management_form.cleaned_data[TOTAL_FORM_COUNT] > self.absolute_max:
+ self.total_form_count() - len(self.deleted_forms) > self.max_num) or \
+ self.management_form.cleaned_data[TOTAL_FORM_COUNT] > self.absolute_max:
raise ValidationError(ungettext(
"Please submit %d or fewer forms.",
"Please submit %d or fewer forms.", self.max_num) % self.max_num,
code='too_many_forms',
)
if (self.validate_min and
- self.total_form_count() - len(self.deleted_forms) < self.min_num):
+ self.total_form_count() - len(self.deleted_forms) < self.min_num):
raise ValidationError(ungettext(
"Please submit %d or more forms.",
"Please submit %d or more forms.", self.min_num) % self.min_num,
View
6 django/forms/models.py
@@ -524,7 +524,7 @@ def modelform_factory(model, form=ModelForm, fields=None, exclude=None,
# be difficult to debug for code that needs updating, so we produce the
# warning here too.
if (getattr(Meta, 'fields', None) is None and
- getattr(Meta, 'exclude', None) is None):
+ getattr(Meta, 'exclude', None) is None):
warnings.warn("Calling modelform_factory without defining 'fields' or "
"'exclude' explicitly is deprecated",
DeprecationWarning, stacklevel=2)
@@ -675,7 +675,7 @@ def validate_unique(self):
for form in valid_forms:
# see if we have data for both fields
if (form.cleaned_data and form.cleaned_data[field] is not None
- and form.cleaned_data[unique_for] is not None):
+ and form.cleaned_data[unique_for] is not None):
# if it's a date lookup we need to get the data for all the fields
if lookup == 'date':
date = form.cleaned_data[unique_for]
@@ -815,7 +815,7 @@ def modelformset_factory(model, form=ModelForm, formfield_callback=None,
if meta is None:
meta = type(str('Meta'), (object,), {})
if (getattr(meta, 'fields', fields) is None and
- getattr(meta, 'exclude', exclude) is None):
+ getattr(meta, 'exclude', exclude) is None):
warnings.warn("Calling modelformset_factory without defining 'fields' or "
"'exclude' explicitly is deprecated",
DeprecationWarning, stacklevel=2)
View
2  django/http/request.py
@@ -66,7 +66,7 @@ def get_host(self):
"""Returns the HTTP host using the environment or request headers."""
# We try three options, in order of decreasing preference.
if settings.USE_X_FORWARDED_HOST and (
- 'HTTP_X_FORWARDED_HOST' in self.META):
+ 'HTTP_X_FORWARDED_HOST' in self.META):
host = self.META['HTTP_X_FORWARDED_HOST']
elif 'HTTP_HOST' in self.META:
host = self.META['HTTP_HOST']
View
2  django/middleware/common.py
@@ -122,7 +122,7 @@ def process_response(self, request, response):
etag = '"%s"' % hashlib.md5(response.content).hexdigest()
if etag is not None:
if (200 <= response.status_code < 300
- and request.META.get('HTTP_IF_NONE_MATCH') == etag):
+ and request.META.get('HTTP_IF_NONE_MATCH') == etag):
cookies = response.cookies
response = http.HttpResponseNotModified()
response.cookies = cookies
View
2  django/template/defaultfilters.py
@@ -40,7 +40,7 @@ def _dec(*args, **kwargs):
args = list(args)
args[0] = force_text(args[0])
if (isinstance(args[0], SafeData) and
- getattr(_dec._decorated_function, 'is_safe', False)):
+ getattr(_dec._decorated_function, 'is_safe', False)):
return mark_safe(func(*args, **kwargs))
return func(*args, **kwargs)
View
2  django/template/loader_tags.py
@@ -70,7 +70,7 @@ def render(self, context):
def super(self):
render_context = self.context.render_context
if (BLOCK_CONTEXT_KEY in render_context and
- render_context[BLOCK_CONTEXT_KEY].get_block(self.name) is not None):
+ render_context[BLOCK_CONTEXT_KEY].get_block(self.name) is not None):
return mark_safe(self.render(self.context))
return ''
View
2  django/test/runner.py
@@ -272,7 +272,7 @@ def setup_databases(verbosity, interactive, **kwargs):
mirrors = []
for signature, (db_name, aliases) in dependency_ordered(
- test_databases.items(), dependencies):
+ test_databases.items(), dependencies):
test_db_name = None
# Actually create the database for the first connection
for alias in aliases:
View
8 django/test/testcases.py
@@ -298,7 +298,7 @@ def _assert_contains(self, response, text, status_code, msg_prefix, html):
# If the response supports deferred rendering and hasn't been rendered
# yet, then ensure that it does get rendered before proceeding further.
if (hasattr(response, 'render') and callable(response.render)
- and not response.is_rendered):
+ and not response.is_rendered):
response.render()
if msg_prefix:
@@ -1043,7 +1043,7 @@ def run(self):
(self.host, port), QuietWSGIRequestHandler)
except socket.error as e:
if (index + 1 < len(self.possible_ports) and
- e.errno == errno.EADDRINUSE):
+ e.errno == errno.EADDRINUSE):
# This port is already in use, so we go on and try with
# the next one in the list.
continue
@@ -1097,7 +1097,7 @@ def setUpClass(cls):
# If using in-memory sqlite databases, pass the connections to
# the server thread.
if (conn.vendor == 'sqlite'
- and conn.settings_dict['NAME'] == ':memory:'):
+ and conn.settings_dict['NAME'] == ':memory:'):
# Explicitly enable thread-shareability for this connection
conn.allow_thread_sharing = True
connections_override[conn.alias] = conn
@@ -1154,7 +1154,7 @@ def _tearDownClassInternal(cls):
# Restore sqlite connections' non-sharability
for conn in connections.all():
if (conn.vendor == 'sqlite'
- and conn.settings_dict['NAME'] == ':memory:'):
+ and conn.settings_dict['NAME'] == ':memory:'):
conn.allow_thread_sharing = False
@classmethod
View
4 django/utils/_os.py
@@ -74,8 +74,8 @@ def safe_join(base, *paths):
# b) The final path must be the same as the base path.
# c) The base path must be the most root path (meaning either "/" or "C:\\")
if (not normcase(final_path).startswith(normcase(base_path + sep)) and
- normcase(final_path) != normcase(base_path) and
- dirname(normcase(base_path)) != normcase(base_path)):
+ normcase(final_path) != normcase(base_path) and
+ dirname(normcase(base_path)) != normcase(base_path)):
raise ValueError('The joined path (%s) is located outside of the base '
'path component (%s)' % (final_path, base_path))
return final_path
View
6 django/utils/feedgenerator.py
@@ -113,9 +113,9 @@ def __init__(self, title, link, description, language=None, author_email=None,
self.items = []
def add_item(self, title, link, description, author_email=None,
- author_name=None, author_link=None, pubdate=None, comments=None,
- unique_id=None, unique_id_is_permalink=None, enclosure=None,
- categories=(), item_copyright=None, ttl=None, updateddate=None, **kwargs):
+ author_name=None, author_link=None, pubdate=None, comments=None,
+ unique_id=None, unique_id_is_permalink=None, enclosure=None,
+ categories=(), item_copyright=None, ttl=None, updateddate=None, **kwargs):
"""
Adds an item to the feed. All args are expected to be Python Unicode
objects except pubdate and updateddate, which are datetime.datetime
View
2  django/utils/html.py
@@ -238,7 +238,7 @@ def trim_url(x, limit=trim_url_limit):
lead = lead + opening
# Keep parentheses at the end only if they're balanced.
if (middle.endswith(closing)
- and middle.count(closing) == middle.count(opening) + 1):
+ and middle.count(closing) == middle.count(opening) + 1):
middle = middle[:-len(closing)]
trail = closing + trail
View
6 django/views/debug.py
@@ -189,7 +189,7 @@ def get_traceback_frame_variables(self, request, tb_frame):
sensitive_variables = None
while current_frame is not None:
if (current_frame.f_code.co_name == 'sensitive_variables_wrapper'
- and 'sensitive_variables_wrapper' in current_frame.f_locals):
+ and 'sensitive_variables_wrapper' in current_frame.f_locals):
# The sensitive_variables decorator was used, so we take note
# of the sensitive variables' names.
wrapper = current_frame.f_locals['sensitive_variables_wrapper']
@@ -218,7 +218,7 @@ def get_traceback_frame_variables(self, request, tb_frame):
cleansed[name] = self.cleanse_special_types(request, value)
if (tb_frame.f_code.co_name == 'sensitive_variables_wrapper'
- and 'sensitive_variables_wrapper' in tb_frame.f_locals):
+ and 'sensitive_variables_wrapper' in tb_frame.f_locals):
# For good measure, obfuscate the decorated function's arguments in
# the sensitive_variables decorator's frame, in case the variables
# associated with those arguments were meant to be obfuscated from
@@ -287,7 +287,7 @@ def get_traceback_data(self):
'templates': template_list,
})
if (settings.TEMPLATE_DEBUG and
- hasattr(self.exc_value, 'django_template_source')):
+ hasattr(self.exc_value, 'django_template_source')):
self.get_template_exception_info()
frames = self.get_traceback_frames()
View
2  django/views/generic/list.py
@@ -150,7 +150,7 @@ def get(self, request, *args, **kwargs):
# it's better to do a cheap query than to load the unpaginated
# queryset in memory.
if (self.get_paginate_by(self.object_list) is not None
- and hasattr(self.object_list, 'exists')):
+ and hasattr(self.object_list, 'exists')):
is_empty = not self.object_list.exists()
else:
is_empty = len(self.object_list) == 0
View
4 extras/csrf_migration_helper.py
@@ -145,11 +145,11 @@ def get_template_dirs():
from django.conf import settings
dirs = set()
if ('django.template.loaders.filesystem.load_template_source' in settings.TEMPLATE_LOADERS
- or 'django.template.loaders.filesystem.Loader' in settings.TEMPLATE_LOADERS):
+ or 'django.template.loaders.filesystem.Loader' in settings.TEMPLATE_LOADERS):
dirs.update(map(unicode, settings.TEMPLATE_DIRS))
if ('django.template.loaders.app_directories.load_template_source' in settings.TEMPLATE_LOADERS
- or 'django.template.loaders.app_directories.Loader' in settings.TEMPLATE_LOADERS):
+ or 'django.template.loaders.app_directories.Loader' in settings.TEMPLATE_LOADERS):
from django.template.loaders.app_directories import app_template_dirs
dirs.update(app_template_dirs)
return dirs
View
2  tests/defer/tests.py
@@ -11,7 +11,7 @@ def assert_delayed(self, obj, num):
count = 0
for field in obj._meta.fields:
if isinstance(obj.__class__.__dict__.get(field.attname),
- DeferredAttribute):
+ DeferredAttribute):
count += 1
self.assertEqual(count, num)
View
10 tests/runtests.py
@@ -69,11 +69,11 @@ def get_test_modules():
for modpath, dirpath in discovery_paths:
for f in os.listdir(dirpath):
if ('.' in f or
- # Python 3 byte code dirs (PEP 3147)
- f == '__pycache__' or
- f.startswith('sql') or
- os.path.basename(f) in SUBDIRS_TO_SKIP or
- os.path.isfile(f)):
+ # Python 3 byte code dirs (PEP 3147)
+ f == '__pycache__' or
+ f.startswith('sql') or
+ os.path.basename(f) in SUBDIRS_TO_SKIP or
+ os.path.isfile(f)):
continue
modules.append((modpath, f))
return modules
View
8 tests/wsgi/tests.py
@@ -93,15 +93,15 @@ def mock_get_wsgi_app():
@override_settings(WSGI_APPLICATION="wsgi.noexist.app")
def test_bad_module(self):
with six.assertRaisesRegex(self,
- ImproperlyConfigured,
- r"^WSGI application 'wsgi.noexist.app' could not be loaded; Error importing.*"):
+ ImproperlyConfigured,
+ r"^WSGI application 'wsgi.noexist.app' could not be loaded; Error importing.*"):
get_internal_wsgi_application()
@override_settings(WSGI_APPLICATION="wsgi.wsgi.noexist")
def test_bad_name(self):
with six.assertRaisesRegex(self,
- ImproperlyConfigured,
- r"^WSGI application 'wsgi.wsgi.noexist' could not be loaded; Module.*"):
+ ImproperlyConfigured,
+ r"^WSGI application 'wsgi.wsgi.noexist' could not be loaded; Module.*"):
get_internal_wsgi_application()
Please sign in to comment.
Something went wrong with that request. Please try again.