summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/conf/__init__.py5
-rw-r--r--django/conf/global_settings.py80
-rw-r--r--django/conf/locale/ca/formats.py8
-rw-r--r--django/conf/locale/cs/formats.py12
-rw-r--r--django/conf/locale/cy/formats.py8
-rw-r--r--django/conf/locale/da/formats.py8
-rw-r--r--django/conf/locale/de/formats.py8
-rw-r--r--django/conf/locale/de_CH/formats.py8
-rw-r--r--django/conf/locale/el/formats.py8
-rw-r--r--django/conf/locale/en/formats.py8
-rw-r--r--django/conf/locale/en_AU/formats.py8
-rw-r--r--django/conf/locale/en_GB/formats.py8
-rw-r--r--django/conf/locale/eo/formats.py12
-rw-r--r--django/conf/locale/es/formats.py8
-rw-r--r--django/conf/locale/es_AR/formats.py8
-rw-r--r--django/conf/locale/es_MX/formats.py8
-rw-r--r--django/conf/locale/es_NI/formats.py8
-rw-r--r--django/conf/locale/es_PR/formats.py8
-rw-r--r--django/conf/locale/fi/formats.py12
-rw-r--r--django/conf/locale/fr/formats.py12
-rw-r--r--django/conf/locale/hr/formats.py8
-rw-r--r--django/conf/locale/hu/formats.py12
-rw-r--r--django/conf/locale/id/formats.py12
-rw-r--r--django/conf/locale/it/formats.py8
-rw-r--r--django/conf/locale/ka/formats.py8
-rw-r--r--django/conf/locale/ko/formats.py12
-rw-r--r--django/conf/locale/lt/formats.py12
-rw-r--r--django/conf/locale/lv/formats.py12
-rw-r--r--django/conf/locale/mk/formats.py8
-rw-r--r--django/conf/locale/ml/formats.py8
-rw-r--r--django/conf/locale/nb/formats.py8
-rw-r--r--django/conf/locale/nl/formats.py12
-rw-r--r--django/conf/locale/nn/formats.py8
-rw-r--r--django/conf/locale/pl/formats.py8
-rw-r--r--django/conf/locale/pt/formats.py8
-rw-r--r--django/conf/locale/pt_BR/formats.py8
-rw-r--r--django/conf/locale/ru/formats.py8
-rw-r--r--django/conf/locale/sk/formats.py8
-rw-r--r--django/conf/locale/sl/formats.py8
-rw-r--r--django/conf/locale/sr/formats.py8
-rw-r--r--django/conf/locale/sr_Latn/formats.py8
-rw-r--r--django/conf/locale/sv/formats.py8
-rw-r--r--django/conf/locale/tr/formats.py8
-rw-r--r--django/conf/locale/zh_Hans/formats.py12
-rw-r--r--django/conf/locale/zh_Hant/formats.py12
-rw-r--r--django/conf/project_template/project_name/settings.py8
-rw-r--r--django/contrib/auth/checks.py2
-rw-r--r--django/contrib/auth/tests/settings.py8
-rw-r--r--django/contrib/auth/tests/test_auth_backends.py54
-rw-r--r--django/contrib/auth/tests/test_context_processors.py2
-rw-r--r--django/contrib/auth/tests/test_forms.py12
-rw-r--r--django/contrib/auth/tests/test_remote_user.py18
-rw-r--r--django/contrib/auth/tests/test_signals.py2
-rw-r--r--django/contrib/auth/tests/test_templates.py2
-rw-r--r--django/contrib/auth/tests/test_views.py28
-rw-r--r--django/contrib/flatpages/tests/test_csrf.py4
-rw-r--r--django/contrib/flatpages/tests/test_forms.py4
-rw-r--r--django/contrib/flatpages/tests/test_middleware.py8
-rw-r--r--django/contrib/flatpages/tests/test_templatetags.py4
-rw-r--r--django/contrib/flatpages/tests/test_views.py8
-rw-r--r--django/core/management/commands/makemessages.py2
-rw-r--r--django/templatetags/i18n.py2
-rw-r--r--django/utils/formats.py8
-rw-r--r--django/views/i18n.py2
-rw-r--r--docs/howto/auth-remote-user.txt8
-rw-r--r--docs/howto/error-reporting.txt10
-rw-r--r--docs/howto/static-files/index.txt4
-rw-r--r--docs/internals/contributing/writing-documentation.txt8
-rw-r--r--docs/intro/reusable-apps.txt4
-rw-r--r--docs/intro/tutorial01.txt4
-rw-r--r--docs/ref/clickjacking.txt4
-rw-r--r--docs/ref/contrib/gis/tutorial.txt4
-rw-r--r--docs/ref/settings.txt118
-rw-r--r--docs/ref/templates/api.txt2
-rw-r--r--docs/ref/templates/upgrading.txt4
-rw-r--r--docs/releases/1.9.txt6
-rw-r--r--docs/topics/auth/customizing.txt4
-rw-r--r--docs/topics/auth/passwords.txt12
-rw-r--r--docs/topics/cache.txt4
-rw-r--r--docs/topics/db/models.txt4
-rw-r--r--docs/topics/http/file-uploads.txt4
-rw-r--r--docs/topics/http/middleware.txt6
-rw-r--r--docs/topics/i18n/translation.txt14
-rw-r--r--docs/topics/testing/overview.txt4
-rw-r--r--tests/admin_changelist/tests.py2
-rw-r--r--tests/admin_custom_urls/tests.py4
-rw-r--r--tests/admin_docs/tests.py2
-rw-r--r--tests/admin_inlines/tests.py8
-rw-r--r--tests/admin_views/tests.py80
-rw-r--r--tests/admin_widgets/tests.py16
-rw-r--r--tests/cache/tests.py4
-rw-r--r--tests/check_framework/tests.py2
-rw-r--r--tests/context_processors/tests.py2
-rw-r--r--tests/file_uploads/tests.py2
-rw-r--r--tests/forms_tests/tests/test_input_formats.py2
-rw-r--r--tests/generic_inline_admin/tests.py6
-rw-r--r--tests/i18n/contenttypes/tests.py8
-rw-r--r--tests/i18n/patterns/tests.py16
-rw-r--r--tests/i18n/test_compilation.py10
-rw-r--r--tests/i18n/test_extraction.py3
-rw-r--r--tests/i18n/tests.py34
-rw-r--r--tests/logging_tests/tests.py16
-rw-r--r--tests/mail/tests.py2
-rw-r--r--tests/middleware/tests.py4
-rw-r--r--tests/middleware_exceptions/tests.py8
-rw-r--r--tests/model_regress/test_pickle.py2
-rw-r--r--tests/proxy_models/tests.py2
-rwxr-xr-xtests/runtests.py6
-rw-r--r--tests/settings_tests/tests.py12
-rw-r--r--tests/staticfiles_tests/tests.py18
-rw-r--r--tests/template_tests/test_response.py4
-rw-r--r--tests/test_client/tests.py4
-rw-r--r--tests/test_client_regress/tests.py12
-rw-r--r--tests/test_sqlite.py4
-rw-r--r--tests/timezones/tests.py2
-rw-r--r--tests/urlpatterns_reverse/tests.py24
-rw-r--r--tests/utils_tests/test_autoreload.py2
-rw-r--r--tests/view_tests/tests/test_csrf.py4
-rw-r--r--tests/view_tests/tests/test_debug.py6
-rw-r--r--tests/view_tests/tests/test_i18n.py12
120 files changed, 612 insertions, 616 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 7ca099b47b..63d32be9c9 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -15,7 +15,6 @@ from django.conf import global_settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.functional import LazyObject, empty
-from django.utils import six
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
@@ -103,8 +102,8 @@ class Settings(BaseSettings):
setting_value = getattr(mod, setting)
if (setting in tuple_settings and
- isinstance(setting_value, six.string_types)):
- raise ImproperlyConfigured("The %s setting must be a tuple. "
+ not isinstance(setting_value, (list, tuple))):
+ raise ImproperlyConfigured("The %s setting must be a list or a tuple. "
"Please fix your settings." % setting)
setattr(self, setting, setting_value)
self._explicit_settings.add(setting)
diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
index 597091916a..41abd4f499 100644
--- a/django/conf/global_settings.py
+++ b/django/conf/global_settings.py
@@ -21,13 +21,13 @@ DEBUG_PROPAGATE_EXCEPTIONS = False
USE_ETAGS = False
# People who get code error notifications.
-# In the format (('Full Name', 'email@example.com'), ('Full Name', 'anotheremail@example.com'))
-ADMINS = ()
+# In the format [('Full Name', 'email@example.com'), ('Full Name', 'anotheremail@example.com')]
+ADMINS = []
-# Tuple of IP addresses, as strings, that:
+# List of IP addresses, as strings, that:
# * See debug comments, when DEBUG is true
# * Receive x-headers
-INTERNAL_IPS = ()
+INTERNAL_IPS = []
# Hosts/domain names that are valid for this site.
# "*" matches anything, ".example.com" matches example.com and all subdomains
@@ -47,7 +47,7 @@ USE_TZ = False
LANGUAGE_CODE = 'en-us'
# Languages we provide translations for, out of the box.
-LANGUAGES = (
+LANGUAGES = [
('af', gettext_noop('Afrikaans')),
('ar', gettext_noop('Arabic')),
('ast', gettext_noop('Asturian')),
@@ -132,15 +132,15 @@ LANGUAGES = (
('vi', gettext_noop('Vietnamese')),
('zh-hans', gettext_noop('Simplified Chinese')),
('zh-hant', gettext_noop('Traditional Chinese')),
-)
+]
# Languages using BiDi (right-to-left) layout
-LANGUAGES_BIDI = ("he", "ar", "fa", "ur")
+LANGUAGES_BIDI = ["he", "ar", "fa", "ur"]
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
-LOCALE_PATHS = ()
+LOCALE_PATHS = []
# Settings for language cookie
LANGUAGE_COOKIE_NAME = 'django_language'
@@ -197,24 +197,24 @@ EMAIL_SSL_KEYFILE = None
EMAIL_TIMEOUT = None
# List of strings representing installed apps.
-INSTALLED_APPS = ()
+INSTALLED_APPS = []
# List of locations of the template source files, in search order.
-TEMPLATE_DIRS = ()
+TEMPLATE_DIRS = []
# List of callables that know how to import templates from various sources.
# See the comments in django/core/template/loader.py for interface
# documentation.
-TEMPLATE_LOADERS = (
+TEMPLATE_LOADERS = [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
-)
+]
# List of processors used by RequestContext to populate the context.
# Each one should be a callable that takes the request object as its
# only parameter and returns a dictionary to add to the context.
-TEMPLATE_CONTEXT_PROCESSORS = (
+TEMPLATE_CONTEXT_PROCESSORS = [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
@@ -223,7 +223,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.template.context_processors.tz',
# 'django.template.context_processors.request',
'django.contrib.messages.context_processors.messages',
-)
+]
# Output to use in template system for invalid (e.g. misspelled) variables.
TEMPLATE_STRING_IF_INVALID = ''
@@ -251,31 +251,31 @@ FORCE_SCRIPT_NAME = None
# that are not allowed to visit any page, systemwide. Use this for bad
# robots/crawlers. Here are a few examples:
# import re
-# DISALLOWED_USER_AGENTS = (
+# DISALLOWED_USER_AGENTS = [
# re.compile(r'^NaverBot.*'),
# re.compile(r'^EmailSiphon.*'),
# re.compile(r'^SiteSucker.*'),
# re.compile(r'^sohu-search')
-# )
-DISALLOWED_USER_AGENTS = ()
+# ]
+DISALLOWED_USER_AGENTS = []
ABSOLUTE_URL_OVERRIDES = {}
-# Tuple of strings representing allowed prefixes for the {% ssi %} tag.
-# Example: ('/home/html', '/var/www')
-ALLOWED_INCLUDE_ROOTS = ()
+# List of strings representing allowed prefixes for the {% ssi %} tag.
+# Example: ['/home/html', '/var/www']
+ALLOWED_INCLUDE_ROOTS = []
# List of compiled regular expression objects representing URLs that need not
# be reported by BrokenLinkEmailsMiddleware. Here are a few examples:
# import re
-# IGNORABLE_404_URLS = (
+# IGNORABLE_404_URLS = [
# re.compile(r'^/apple-touch-icon.*\.png$'),
# re.compile(r'^/favicon.ico$),
# re.compile(r'^/robots.txt$),
# re.compile(r'^/phpmyadmin/),
# re.compile(r'\.(cgi|php|pl)$'),
-# )
-IGNORABLE_404_URLS = ()
+# ]
+IGNORABLE_404_URLS = []
# A secret key for this particular Django installation. Used in secret-key
# hashing algorithms. Set this in your settings, or Django will complain
@@ -302,10 +302,10 @@ STATIC_ROOT = None
STATIC_URL = None
# List of upload handler classes to be applied in order.
-FILE_UPLOAD_HANDLERS = (
+FILE_UPLOAD_HANDLERS = [
'django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler',
-)
+]
# Maximum size, in bytes, of a request before it will be streamed to the
# file system instead of into memory.
@@ -366,30 +366,30 @@ SHORT_DATETIME_FORMAT = 'm/d/Y P'
# See all available format string here:
# http://docs.python.org/library/datetime.html#strftime-behavior
# * Note that these format strings are different from the ones to display dates
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
-)
+]
# Default formats to be used when parsing times from input boxes, in order
# See all available format string here:
# http://docs.python.org/library/datetime.html#strftime-behavior
# * Note that these format strings are different from the ones to display dates
-TIME_INPUT_FORMATS = (
+TIME_INPUT_FORMATS = [
'%H:%M:%S', # '14:30:59'
'%H:%M:%S.%f', # '14:30:59.000200'
'%H:%M', # '14:30'
-)
+]
# Default formats to be used when parsing dates and times from input boxes,
# in order
# See all available format string here:
# http://docs.python.org/library/datetime.html#strftime-behavior
# * Note that these format strings are different from the ones to display dates
-DATETIME_INPUT_FORMATS = (
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -402,7 +402,7 @@ DATETIME_INPUT_FORMATS = (
'%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
-)
+]
# First day of week, to be used on calendars
# 0 means Sunday, 1 means Monday...
@@ -453,10 +453,10 @@ SECURE_PROXY_SSL_HEADER = None
# List of middleware classes to use. Order is important; in the request phase,
# this middleware classes will be applied in the order given, and in the
# response phase the middleware will be applied in reverse order.
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE_CLASSES = [
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
-)
+]
############
# SESSIONS #
@@ -508,7 +508,7 @@ CACHE_MIDDLEWARE_ALIAS = 'default'
AUTH_USER_MODEL = 'auth.User'
-AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
+AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']
LOGIN_URL = '/accounts/login/'
@@ -522,7 +522,7 @@ PASSWORD_RESET_TIMEOUT_DAYS = 3
# the first hasher in this list is the preferred algorithm. any
# password using different algorithms will be converted automatically
# upon login
-PASSWORD_HASHERS = (
+PASSWORD_HASHERS = [
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
@@ -532,7 +532,7 @@ PASSWORD_HASHERS = (
'django.contrib.auth.hashers.UnsaltedSHA1PasswordHasher',
'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
-)
+]
###########
# SIGNING #
@@ -596,25 +596,25 @@ TEST_NON_SERIALIZED_APPS = []
############
# The list of directories to search for fixtures
-FIXTURE_DIRS = ()
+FIXTURE_DIRS = []
###############
# STATICFILES #
###############
# A list of locations of additional static files
-STATICFILES_DIRS = ()
+STATICFILES_DIRS = []
# The default file storage backend used during the build process
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
# List of finder classes that know how to find static files in
# various locations.
-STATICFILES_FINDERS = (
+STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
-)
+]
##############
# MIGRATIONS #
diff --git a/django/conf/locale/ca/formats.py b/django/conf/locale/ca/formats.py
index 5acd742907..d42016b716 100644
--- a/django/conf/locale/ca/formats.py
+++ b/django/conf/locale/ca/formats.py
@@ -16,18 +16,18 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
# '31/12/2009', '31/12/09'
'%d/%m/%Y', '%d/%m/%y'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M:%S.%f',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M:%S.%f',
'%d/%m/%y %H:%M',
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/cs/formats.py b/django/conf/locale/cs/formats.py
index 45e2a898a3..3f2d3fa70e 100644
--- a/django/conf/locale/cs/formats.py
+++ b/django/conf/locale/cs/formats.py
@@ -16,18 +16,18 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', '%d.%m.%y', # '05.01.2006', '05.01.06'
'%d. %m. %Y', '%d. %m. %y', # '5. 1. 2006', '5. 1. 06'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
-)
+]
# Kept ISO formats as one is in first position
-TIME_INPUT_FORMATS = (
+TIME_INPUT_FORMATS = [
'%H:%M:%S', # '04:30:59'
'%H.%M', # '04.30'
'%H:%M', # '04:30'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '05.01.2006 04:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '05.01.2006 04:30:59.000200'
'%d.%m.%Y %H.%M', # '05.01.2006 04.30'
@@ -39,7 +39,7 @@ DATETIME_INPUT_FORMATS = (
'%d. %m. %Y %H:%M', # '05. 01. 2006 04:30'
'%d. %m. %Y', # '05. 01. 2006'
'%Y-%m-%d %H.%M', # '2006-01-05 04.30'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/cy/formats.py b/django/conf/locale/cy/formats.py
index d091619bef..4a69a88e6a 100644
--- a/django/conf/locale/cy/formats.py
+++ b/django/conf/locale/cy/formats.py
@@ -16,10 +16,10 @@ FIRST_DAY_OF_WEEK = 1 # 'Dydd Llun'
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -32,7 +32,7 @@ DATETIME_INPUT_FORMATS = (
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/da/formats.py b/django/conf/locale/da/formats.py
index dcdf35173e..90ba056f79 100644
--- a/django/conf/locale/da/formats.py
+++ b/django/conf/locale/da/formats.py
@@ -16,14 +16,14 @@ FIRST_DAY_OF_WEEK = 1
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', # '25.10.2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/de/formats.py b/django/conf/locale/de/formats.py
index 03e1219b81..cf1283b2a5 100644
--- a/django/conf/locale/de/formats.py
+++ b/django/conf/locale/de/formats.py
@@ -16,16 +16,16 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/de_CH/formats.py b/django/conf/locale/de_CH/formats.py
index 269a85b152..f8a9b90631 100644
--- a/django/conf/locale/de_CH/formats.py
+++ b/django/conf/locale/de_CH/formats.py
@@ -17,16 +17,16 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
-)
+]
# these are the separators for non-monetary numbers. For monetary numbers,
# the DECIMAL_SEPARATOR is a . (decimal point) and the THOUSAND_SEPARATOR is a
diff --git a/django/conf/locale/el/formats.py b/django/conf/locale/el/formats.py
index 429db4b508..7cfcd10e36 100644
--- a/django/conf/locale/el/formats.py
+++ b/django/conf/locale/el/formats.py
@@ -16,10 +16,10 @@ FIRST_DAY_OF_WEEK = 0 # Sunday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', '%Y-%m-%d', # '25/10/2006', '25/10/06', '2006-10-25',
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
@@ -32,7 +32,7 @@ DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/en/formats.py b/django/conf/locale/en/formats.py
index 279cd3c518..63b23fa260 100644
--- a/django/conf/locale/en/formats.py
+++ b/django/conf/locale/en/formats.py
@@ -17,14 +17,14 @@ FIRST_DAY_OF_WEEK = 0 # Sunday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -37,7 +37,7 @@ DATETIME_INPUT_FORMATS = (
'%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/en_AU/formats.py b/django/conf/locale/en_AU/formats.py
index 5dd55743b6..fe97ea98c1 100644
--- a/django/conf/locale/en_AU/formats.py
+++ b/django/conf/locale/en_AU/formats.py
@@ -16,14 +16,14 @@ FIRST_DAY_OF_WEEK = 0 # Sunday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -36,7 +36,7 @@ DATETIME_INPUT_FORMATS = (
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/en_GB/formats.py b/django/conf/locale/en_GB/formats.py
index b2f24c0714..190ec7316d 100644
--- a/django/conf/locale/en_GB/formats.py
+++ b/django/conf/locale/en_GB/formats.py
@@ -16,14 +16,14 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -36,7 +36,7 @@ DATETIME_INPUT_FORMATS = (
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/eo/formats.py b/django/conf/locale/eo/formats.py
index 7a92a628b7..1e61912442 100644
--- a/django/conf/locale/eo/formats.py
+++ b/django/conf/locale/eo/formats.py
@@ -16,7 +16,7 @@ FIRST_DAY_OF_WEEK = 1 # Monday (lundo)
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', # '1887-07-26'
'%y-%m-%d', # '87-07-26'
'%Y %m %d', # '1887 07 26'
@@ -25,12 +25,12 @@ DATE_INPUT_FORMATS = (
'%d-a de %B %Y', # '26-a de julio 1887'
'%d %B %Y', # '26 julio 1887'
'%d %m %Y', # '26 07 1887'
-)
-TIME_INPUT_FORMATS = (
+]
+TIME_INPUT_FORMATS = [
'%H:%M:%S', # '18:59:00'
'%H:%M', # '18:59'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '1887-07-26 18:59:00'
'%Y-%m-%d %H:%M', # '1887-07-26 18:59'
'%Y-%m-%d', # '1887-07-26'
@@ -46,7 +46,7 @@ DATETIME_INPUT_FORMATS = (
'%y-%m-%d %H:%M:%S', # '87-07-26 18:59:00'
'%y-%m-%d %H:%M', # '87-07-26 18:59'
'%y-%m-%d', # '87-07-26'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/es/formats.py b/django/conf/locale/es/formats.py
index a296bee243..701032aefd 100644
--- a/django/conf/locale/es/formats.py
+++ b/django/conf/locale/es/formats.py
@@ -16,18 +16,18 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
# '31/12/2009', '31/12/09'
'%d/%m/%Y', '%d/%m/%y'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M:%S.%f',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M:%S.%f',
'%d/%m/%y %H:%M',
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/es_AR/formats.py b/django/conf/locale/es_AR/formats.py
index 6ad96e8dcd..9daf38d8ef 100644
--- a/django/conf/locale/es_AR/formats.py
+++ b/django/conf/locale/es_AR/formats.py
@@ -16,18 +16,18 @@ FIRST_DAY_OF_WEEK = 0 # 0: Sunday, 1: Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', # '31/12/2009'
'%d/%m/%y', # '31/12/09'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M:%S.%f',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M:%S.%f',
'%d/%m/%y %H:%M',
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/es_MX/formats.py b/django/conf/locale/es_MX/formats.py
index 3ea2b28797..d15041660d 100644
--- a/django/conf/locale/es_MX/formats.py
+++ b/django/conf/locale/es_MX/formats.py
@@ -11,18 +11,18 @@ MONTH_DAY_FORMAT = r'j \d\e F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday: ISO 8601
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
'%Y%m%d', # '20061025'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M:%S.%f',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M:%S.%f',
'%d/%m/%y %H:%M',
-)
+]
DECIMAL_SEPARATOR = '.' # ',' is also official (less common): NOM-008-SCFI-2002
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/es_NI/formats.py b/django/conf/locale/es_NI/formats.py
index da524d9991..cc03b2cd2c 100644
--- a/django/conf/locale/es_NI/formats.py
+++ b/django/conf/locale/es_NI/formats.py
@@ -11,19 +11,19 @@ MONTH_DAY_FORMAT = r'j \d\e F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday: ISO 8601
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
'%Y%m%d', # '20061025'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M:%S.%f',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M:%S.%f',
'%d/%m/%y %H:%M',
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/es_PR/formats.py b/django/conf/locale/es_PR/formats.py
index dc16323e7a..c6680f7975 100644
--- a/django/conf/locale/es_PR/formats.py
+++ b/django/conf/locale/es_PR/formats.py
@@ -12,18 +12,18 @@ SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 0 # Sunday
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
# '31/12/2009', '31/12/09'
'%d/%m/%Y', '%d/%m/%y'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M:%S.%f',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M:%S.%f',
'%d/%m/%y %H:%M',
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
diff --git a/django/conf/locale/fi/formats.py b/django/conf/locale/fi/formats.py
index 5a0dc2d576..b5c74211a3 100644
--- a/django/conf/locale/fi/formats.py
+++ b/django/conf/locale/fi/formats.py
@@ -16,11 +16,11 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', # '20.3.2014'
'%d.%m.%y', # '20.3.14'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H.%M.%S', # '20.3.2014 14.30.59'
'%d.%m.%Y %H.%M.%S.%f', # '20.3.2014 14.30.59.000200'
'%d.%m.%Y %H.%M', # '20.3.2014 14.30'
@@ -30,12 +30,12 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y %H.%M.%S.%f', # '20.3.14 14.30.59.000200'
'%d.%m.%y %H.%M', # '20.3.14 14.30'
'%d.%m.%y', # '20.3.14'
-)
-TIME_INPUT_FORMATS = (
+]
+TIME_INPUT_FORMATS = [
'%H.%M.%S', # '14.30.59'
'%H.%M.%S.%f', # '14.30.59.000200'
'%H.%M', # '14.30'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # Non-breaking space
diff --git a/django/conf/locale/fr/formats.py b/django/conf/locale/fr/formats.py
index 4e2391fd72..ed6d8c7aaa 100644
--- a/django/conf/locale/fr/formats.py
+++ b/django/conf/locale/fr/formats.py
@@ -16,21 +16,21 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
- '%d.%m.%Y', '%d.%m.%y', # Swiss (fr_CH), '25.10.2006', '25.10.06'
+ '%d.%m.%Y', '%d.%m.%y', # Swiss [fr_CH), '25.10.2006', '25.10.06'
# '%d %B %Y', '%d %b %Y', # '25 octobre 2006', '25 oct. 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
'%d/%m/%Y', # '25/10/2006'
- '%d.%m.%Y %H:%M:%S', # Swiss (fr_CH), '25.10.2006 14:30:59'
+ '%d.%m.%Y %H:%M:%S', # Swiss [fr_CH), '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # Swiss (fr_CH), '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # Swiss (fr_CH), '25.10.2006 14:30'
'%d.%m.%Y', # Swiss (fr_CH), '25.10.2006'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/hr/formats.py b/django/conf/locale/hr/formats.py
index 275978acbf..59bcb8657d 100644
--- a/django/conf/locale/hr/formats.py
+++ b/django/conf/locale/hr/formats.py
@@ -17,12 +17,12 @@ FIRST_DAY_OF_WEEK = 1
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', # '2006-10-25'
'%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'
'%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -43,7 +43,7 @@ DATETIME_INPUT_FORMATS = (
'%d. %m. %y. %H:%M:%S.%f', # '25. 10. 06. 14:30:59.000200'
'%d. %m. %y. %H:%M', # '25. 10. 06. 14:30'
'%d. %m. %y.', # '25. 10. 06.'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
diff --git a/django/conf/locale/hu/formats.py b/django/conf/locale/hu/formats.py
index a74b35b74c..e17e8c99ad 100644
--- a/django/conf/locale/hu/formats.py
+++ b/django/conf/locale/hu/formats.py
@@ -16,19 +16,19 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y.%m.%d.', # '2006.10.25.'
-)
-TIME_INPUT_FORMATS = (
+]
+TIME_INPUT_FORMATS = [
'%H.%M.%S', # '14.30.59'
'%H.%M', # '14.30'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y.%m.%d. %H.%M.%S', # '2006.10.25. 14.30.59'
'%Y.%m.%d. %H.%M.%S.%f', # '2006.10.25. 14.30.59.000200'
'%Y.%m.%d. %H.%M', # '2006.10.25. 14.30'
'%Y.%m.%d.', # '2006.10.25.'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' ' # Non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/id/formats.py b/django/conf/locale/id/formats.py
index ed38b0270b..dc3dbf9dd8 100644
--- a/django/conf/locale/id/formats.py
+++ b/django/conf/locale/id/formats.py
@@ -16,19 +16,19 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d-%m-%y', '%d/%m/%y', # '25-10-09', 25/10/09'
'%d-%m-%Y', '%d/%m/%Y', # '25-10-2009', 25/10/2009'
'%d %b %Y', # '25 Oct 2006',
'%d %B %Y', # '25 October 2006'
-)
+]
-TIME_INPUT_FORMATS = (
+TIME_INPUT_FORMATS = [
'%H.%M.%S', # '14.30.59'
'%H.%M', # '14.30'
-)
+]
-DATETIME_INPUT_FORMATS = (
+DATETIME_INPUT_FORMATS = [
'%d-%m-%Y %H.%M.%S', # '25-10-2009 14.30.59'
'%d-%m-%Y %H.%M.%S.%f', # '25-10-2009 14.30.59.000200'
'%d-%m-%Y %H.%M', # '25-10-2009 14.30'
@@ -45,7 +45,7 @@ DATETIME_INPUT_FORMATS = (
'%m/%d/%Y %H.%M.%S.%f', # '25/10/2009 14.30.59.000200'
'%m/%d/%Y %H.%M', # '25/10/2009 14.30'
'%m/%d/%Y', # '10/25/2009'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
diff --git a/django/conf/locale/it/formats.py b/django/conf/locale/it/formats.py
index f8fbac2ee2..054b973f0a 100644
--- a/django/conf/locale/it/formats.py
+++ b/django/conf/locale/it/formats.py
@@ -16,12 +16,12 @@ FIRST_DAY_OF_WEEK = 1 # Lunedì
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%Y/%m/%d', # '25/10/2006', '2008/10/25'
'%d-%m-%Y', '%Y-%m-%d', # '25-10-2006', '2008-10-25'
'%d-%m-%y', '%d/%m/%y', # '25-10-06', '25/10/06'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
@@ -42,7 +42,7 @@ DATETIME_INPUT_FORMATS = (
'%d-%m-%y %H:%M:%S.%f', # '25-10-06 14:30:59.000200'
'%d-%m-%y %H:%M', # '25-10-06 14:30'
'%d-%m-%y', # '25-10-06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/ka/formats.py b/django/conf/locale/ka/formats.py
index 79a984a57c..226f5f721e 100644
--- a/django/conf/locale/ka/formats.py
+++ b/django/conf/locale/ka/formats.py
@@ -17,13 +17,13 @@ FIRST_DAY_OF_WEEK = 1 # (Monday)
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%d %b %Y', '%d %b, %Y', '%d %b. %Y', # '25 Oct 2006', '25 Oct, 2006', '25 Oct. 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
# '%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -44,7 +44,7 @@ DATETIME_INPUT_FORMATS = (
'%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = " "
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/ko/formats.py b/django/conf/locale/ko/formats.py
index 0bafa06ab1..e89f644ca5 100644
--- a/django/conf/locale/ko/formats.py
+++ b/django/conf/locale/ko/formats.py
@@ -17,22 +17,22 @@ SHORT_DATETIME_FORMAT = 'Y-n-j H:i'
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
'%Y년 %m월 %d일', # '2006년 10월 25일', with localized suffix.
-)
-TIME_INPUT_FORMATS = (
+]
+TIME_INPUT_FORMATS = [
'%H:%M:%S', # '14:30:59'
'%H:%M:%S.%f', # '14:30:59.000200'
'%H:%M', # '14:30'
'%H시 %M분 %S초', # '14시 30분 59초'
'%H시 %M분', # '14시 30분'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -48,7 +48,7 @@ DATETIME_INPUT_FORMATS = (
'%Y년 %m월 %d일 %H시 %M분 %S초', # '2006년 10월 25일 14시 30분 59초'
'%Y년 %m월 %d일 %H시 %M분', # '2006년 10월 25일 14시 30분'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
diff --git a/django/conf/locale/lt/formats.py b/django/conf/locale/lt/formats.py
index 6a34ab09fd..d688669b78 100644
--- a/django/conf/locale/lt/formats.py
+++ b/django/conf/locale/lt/formats.py
@@ -16,18 +16,18 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%d.%m.%Y', '%d.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
-)
-TIME_INPUT_FORMATS = (
+]
+TIME_INPUT_FORMATS = [
'%H:%M:%S', # '14:30:59'
'%H:%M:%S.%f', # '14:30:59.000200'
'%H:%M', # '14:30'
'%H.%M.%S', # '14.30.59'
'%H.%M.%S.%f', # '14.30.59.000200'
'%H.%M', # '14.30'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -42,7 +42,7 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y %H.%M.%S.%f', # '25.10.06 14.30.59.000200'
'%d.%m.%y %H.%M', # '25.10.06 14.30'
'%d.%m.%y', # '25.10.06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/lv/formats.py b/django/conf/locale/lv/formats.py
index 28e4d6c3f4..e30a65388c 100644
--- a/django/conf/locale/lv/formats.py
+++ b/django/conf/locale/lv/formats.py
@@ -17,18 +17,18 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%d.%m.%Y', '%d.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
-)
-TIME_INPUT_FORMATS = (
+]
+TIME_INPUT_FORMATS = [
'%H:%M:%S', # '14:30:59'
'%H:%M:%S.%f', # '14:30:59.000200'
'%H:%M', # '14:30'
'%H.%M.%S', # '14.30.59'
'%H.%M.%S.%f', # '14.30.59.000200'
'%H.%M', # '14.30'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -43,7 +43,7 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y %H.%M.%S.%f', # '25.10.06 14.30.59.000200'
'%d.%m.%y %H.%M', # '25.10.06 14.30'
'%d.%m.%y', # '25.10.06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' ' # Non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/mk/formats.py b/django/conf/locale/mk/formats.py
index ea4b0c3402..2f01147a0a 100644
--- a/django/conf/locale/mk/formats.py
+++ b/django/conf/locale/mk/formats.py
@@ -16,12 +16,12 @@ FIRST_DAY_OF_WEEK = 1
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
'%d. %m. %Y', '%d. %m. %y', # '25. 10. 2006', '25. 10. 06'
-)
+]
-DATETIME_INPUT_FORMATS = (
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
@@ -38,7 +38,7 @@ DATETIME_INPUT_FORMATS = (
'%d. %m. %y %H:%M:%S.%f', # '25. 10. 06 14:30:59.000200'
'%d. %m. %y %H:%M', # '25. 10. 06 14:30'
'%d. %m. %y', # '25. 10. 06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
diff --git a/django/conf/locale/ml/formats.py b/django/conf/locale/ml/formats.py
index 279cd3c518..63b23fa260 100644
--- a/django/conf/locale/ml/formats.py
+++ b/django/conf/locale/ml/formats.py
@@ -17,14 +17,14 @@ FIRST_DAY_OF_WEEK = 0 # Sunday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -37,7 +37,7 @@ DATETIME_INPUT_FORMATS = (
'%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/nb/formats.py b/django/conf/locale/nb/formats.py
index 5bf43af0d4..09fa857b4c 100644
--- a/django/conf/locale/nb/formats.py
+++ b/django/conf/locale/nb/formats.py
@@ -17,13 +17,13 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%d.%m.%Y', '%d.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
# '%d. %b %Y', '%d %b %Y', # '25. okt 2006', '25 okt 2006'
# '%d. %b. %Y', '%d %b. %Y', # '25. okt. 2006', '25 okt. 2006'
# '%d. %B %Y', '%d %B %Y', # '25. oktober 2006', '25 oktober 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -36,7 +36,7 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y %H:%M:%S.%f', # '25.10.06 14:30:59.000200'
'%d.%m.%y %H:%M', # '25.10.06 14:30'
'%d.%m.%y', # '25.10.06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/nl/formats.py b/django/conf/locale/nl/formats.py
index d9f54464e6..581848f6e4 100644
--- a/django/conf/locale/nl/formats.py
+++ b/django/conf/locale/nl/formats.py
@@ -16,22 +16,22 @@ FIRST_DAY_OF_WEEK = 1 # Monday (in Dutch 'maandag')
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d-%m-%Y', '%d-%m-%y', # '20-01-2009', '20-01-09'
'%d/%m/%Y', '%d/%m/%y', # '20/01/2009', '20/01/09'
# '%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
# '%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 09'
-)
+]
# Kept ISO formats as one is in first position
-TIME_INPUT_FORMATS = (
+TIME_INPUT_FORMATS = [
'%H:%M:%S', # '15:23:35'
'%H:%M:%S.%f', # '15:23:35.000200'
'%H.%M:%S', # '15.23:35'
'%H.%M:%S.%f', # '15.23:35.000200'
'%H.%M', # '15.23'
'%H:%M', # '15:23'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
# With time in %H:%M:%S :
'%d-%m-%Y %H:%M:%S', '%d-%m-%y %H:%M:%S', '%Y-%m-%d %H:%M:%S',
# '20-01-2009 15:23:35', '20-01-09 15:23:35', '2009-01-20 15:23:35'
@@ -67,7 +67,7 @@ DATETIME_INPUT_FORMATS = (
'%d/%m/%Y', '%d/%m/%y', '%Y/%m/%d', # '20/01/2009', '20/01/09', '2009/01/20'
# '%d %b %Y', '%d %b %y', # '20 jan 2009', '20 jan 09'
# '%d %B %Y', '%d %B %y', # '20 januari 2009', '20 januari 2009'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/nn/formats.py b/django/conf/locale/nn/formats.py
index ca7d2e294c..b2e654c1e1 100644
--- a/django/conf/locale/nn/formats.py
+++ b/django/conf/locale/nn/formats.py
@@ -17,13 +17,13 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%d.%m.%Y', '%d.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
# '%d. %b %Y', '%d %b %Y', # '25. okt 2006', '25 okt 2006'
# '%d. %b. %Y', '%d %b. %Y', # '25. okt. 2006', '25 okt. 2006'
# '%d. %B %Y', '%d %B %Y', # '25. oktober 2006', '25 oktober 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -37,7 +37,7 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y %H:%M:%S.%f', # '25.10.06 14:30:59.000200'
'%d.%m.%y %H:%M', # '25.10.06 14:30'
'%d.%m.%y', # '25.10.06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/pl/formats.py b/django/conf/locale/pl/formats.py
index 3e2c20f6d3..9cc1776494 100644
--- a/django/conf/locale/pl/formats.py
+++ b/django/conf/locale/pl/formats.py
@@ -16,17 +16,17 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
'%y-%m-%d', # '06-10-25'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/pt/formats.py b/django/conf/locale/pt/formats.py
index c9428ef4ea..143351c0cd 100644
--- a/django/conf/locale/pt/formats.py
+++ b/django/conf/locale/pt/formats.py
@@ -17,12 +17,12 @@ FIRST_DAY_OF_WEEK = 0 # Sunday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
# '%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'
# '%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -35,7 +35,7 @@ DATETIME_INPUT_FORMATS = (
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/pt_BR/formats.py b/django/conf/locale/pt_BR/formats.py
index 6057a21056..9f728783c5 100644
--- a/django/conf/locale/pt_BR/formats.py
+++ b/django/conf/locale/pt_BR/formats.py
@@ -16,12 +16,12 @@ FIRST_DAY_OF_WEEK = 0 # Sunday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
# '%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'
# '%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
@@ -30,7 +30,7 @@ DATETIME_INPUT_FORMATS = (
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/ru/formats.py b/django/conf/locale/ru/formats.py
index 727ee75b54..07b1181285 100644
--- a/django/conf/locale/ru/formats.py
+++ b/django/conf/locale/ru/formats.py
@@ -16,11 +16,11 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', # '25.10.2006'
'%d.%m.%y', # '25.10.06'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
@@ -29,7 +29,7 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y %H:%M:%S.%f', # '25.10.06 14:30:59.000200'
'%d.%m.%y %H:%M', # '25.10.06 14:30'
'%d.%m.%y', # '25.10.06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/sk/formats.py b/django/conf/locale/sk/formats.py
index f54a8a89e0..04bdceb000 100644
--- a/django/conf/locale/sk/formats.py
+++ b/django/conf/locale/sk/formats.py
@@ -16,17 +16,17 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
'%y-%m-%d', # '06-10-25'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/sl/formats.py b/django/conf/locale/sl/formats.py
index a2027166e0..a4e9973a55 100644
--- a/django/conf/locale/sl/formats.py
+++ b/django/conf/locale/sl/formats.py
@@ -16,13 +16,13 @@ FIRST_DAY_OF_WEEK = 0
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
'%d-%m-%Y', # '25-10-2006'
'%d. %m. %Y', '%d. %m. %y', # '25. 10. 2006', '25. 10. 06'
-)
+]
-DATETIME_INPUT_FORMATS = (
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
@@ -43,7 +43,7 @@ DATETIME_INPUT_FORMATS = (
'%d. %m. %y %H:%M:%S.%f', # '25. 10. 06 14:30:59.000200'
'%d. %m. %y %H:%M', # '25. 10. 06 14:30'
'%d. %m. %y', # '25. 10. 06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
diff --git a/django/conf/locale/sr/formats.py b/django/conf/locale/sr/formats.py
index 86d63e42f1..5c5e48e20e 100644
--- a/django/conf/locale/sr/formats.py
+++ b/django/conf/locale/sr/formats.py
@@ -16,14 +16,14 @@ FIRST_DAY_OF_WEEK = 1
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'
'%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'
# '%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'
# '%d. %b \'%y.', '%d. %B \'%y.', # '25. Oct '06.', '25. October '06.'
# '%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'
'%d.%m.%Y. %H:%M:%S.%f', # '25.10.2006. 14:30:59.000200'
'%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'
@@ -40,7 +40,7 @@ DATETIME_INPUT_FORMATS = (
'%d. %m. %y. %H:%M:%S.%f', # '25. 10. 06. 14:30:59.000200'
'%d. %m. %y. %H:%M', # '25. 10. 06. 14:30'
'%d. %m. %y.', # '25. 10. 06.'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/sr_Latn/formats.py b/django/conf/locale/sr_Latn/formats.py
index 86d63e42f1..5c5e48e20e 100644
--- a/django/conf/locale/sr_Latn/formats.py
+++ b/django/conf/locale/sr_Latn/formats.py
@@ -16,14 +16,14 @@ FIRST_DAY_OF_WEEK = 1
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'
'%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'
# '%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'
# '%d. %b \'%y.', '%d. %B \'%y.', # '25. Oct '06.', '25. October '06.'
# '%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'
'%d.%m.%Y. %H:%M:%S.%f', # '25.10.2006. 14:30:59.000200'
'%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'
@@ -40,7 +40,7 @@ DATETIME_INPUT_FORMATS = (
'%d. %m. %y. %H:%M:%S.%f', # '25. 10. 06. 14:30:59.000200'
'%d. %m. %y. %H:%M', # '25. 10. 06. 14:30'
'%d. %m. %y.', # '25. 10. 06.'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/sv/formats.py b/django/conf/locale/sv/formats.py
index 7673d472a1..f2de0bc16b 100644
--- a/django/conf/locale/sv/formats.py
+++ b/django/conf/locale/sv/formats.py
@@ -17,12 +17,12 @@ FIRST_DAY_OF_WEEK = 1
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
# Kept ISO formats as they are in first position
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y', # '10/25/06'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -35,7 +35,7 @@ DATETIME_INPUT_FORMATS = (
'%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/tr/formats.py b/django/conf/locale/tr/formats.py
index c01c4a242a..c765f77489 100644
--- a/django/conf/locale/tr/formats.py
+++ b/django/conf/locale/tr/formats.py
@@ -16,17 +16,17 @@ FIRST_DAY_OF_WEEK = 1 # Pazartesi
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
'%y-%m-%d', # '06-10-25'
# '%d %B %Y', '%d %b. %Y', # '25 Ekim 2006', '25 Eki. 2006'
-)
-DATETIME_INPUT_FORMATS = (
+]
+DATETIME_INPUT_FORMATS = [
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
'%d/%m/%Y', # '25/10/2006'
-)
+]
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/zh_Hans/formats.py b/django/conf/locale/zh_Hans/formats.py
index f855dec5b2..b6bac2f90e 100644
--- a/django/conf/locale/zh_Hans/formats.py
+++ b/django/conf/locale/zh_Hans/formats.py
@@ -16,19 +16,19 @@ FIRST_DAY_OF_WEEK = 1 # 星期一 (Monday)
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y/%m/%d', # '2016/09/05'
'%Y-%m-%d', # '2016-09-05'
'%Y年%n月%j日', # '2016年9月5日'
-)
+]
-TIME_INPUT_FORMATS = (
+TIME_INPUT_FORMATS = [
'%H:%M', # '20:45'
'%H:%M:%S', # '20:45:29'
'%H:%M:%S.%f', # '20:45:29.000200'
-)
+]
-DATETIME_INPUT_FORMATS = (
+DATETIME_INPUT_FORMATS = [
'%Y/%m/%d %H:%M', # '2016/09/05 20:45'
'%Y-%m-%d %H:%M', # '2016-09-05 20:45'
'%Y年%n月%j日 %H:%M', # '2016年9月5日 14:45'
@@ -38,7 +38,7 @@ DATETIME_INPUT_FORMATS = (
'%Y/%m/%d %H:%M:%S.%f', # '2016/09/05 20:45:29.000200'
'%Y-%m-%d %H:%M:%S.%f', # '2016-09-05 20:45:29.000200'
'%Y年%n月%j日 %H:%n:%S.%f', # '2016年9月5日 20:45:29.000200'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ''
diff --git a/django/conf/locale/zh_Hant/formats.py b/django/conf/locale/zh_Hant/formats.py
index f855dec5b2..b6bac2f90e 100644
--- a/django/conf/locale/zh_Hant/formats.py
+++ b/django/conf/locale/zh_Hant/formats.py
@@ -16,19 +16,19 @@ FIRST_DAY_OF_WEEK = 1 # 星期一 (Monday)
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
-DATE_INPUT_FORMATS = (
+DATE_INPUT_FORMATS = [
'%Y/%m/%d', # '2016/09/05'
'%Y-%m-%d', # '2016-09-05'
'%Y年%n月%j日', # '2016年9月5日'
-)
+]
-TIME_INPUT_FORMATS = (
+TIME_INPUT_FORMATS = [
'%H:%M', # '20:45'
'%H:%M:%S', # '20:45:29'
'%H:%M:%S.%f', # '20:45:29.000200'
-)
+]
-DATETIME_INPUT_FORMATS = (
+DATETIME_INPUT_FORMATS = [
'%Y/%m/%d %H:%M', # '2016/09/05 20:45'
'%Y-%m-%d %H:%M', # '2016-09-05 20:45'
'%Y年%n月%j日 %H:%M', # '2016年9月5日 14:45'
@@ -38,7 +38,7 @@ DATETIME_INPUT_FORMATS = (
'%Y/%m/%d %H:%M:%S.%f', # '2016/09/05 20:45:29.000200'
'%Y-%m-%d %H:%M:%S.%f', # '2016-09-05 20:45:29.000200'
'%Y年%n月%j日 %H:%n:%S.%f', # '2016年9月5日 20:45:29.000200'
-)
+]
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ''
diff --git a/django/conf/project_template/project_name/settings.py b/django/conf/project_template/project_name/settings.py
index a0a3056075..9d4b38d171 100644
--- a/django/conf/project_template/project_name/settings.py
+++ b/django/conf/project_template/project_name/settings.py
@@ -31,16 +31,16 @@ ALLOWED_HOSTS = []
# Application definition
-INSTALLED_APPS = (
+INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
-)
+]
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
@@ -49,7 +49,7 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
-)
+]
ROOT_URLCONF = '{{ project_name }}.urls'
diff --git a/django/contrib/auth/checks.py b/django/contrib/auth/checks.py
index 853a675f88..2d47377c9a 100644
--- a/django/contrib/auth/checks.py
+++ b/django/contrib/auth/checks.py
@@ -37,7 +37,7 @@ def check_user_model(**kwargs):
# Check that the username field is unique
if not cls._meta.get_field(cls.USERNAME_FIELD).unique:
if (settings.AUTHENTICATION_BACKENDS ==
- ('django.contrib.auth.backends.ModelBackend',)):
+ ['django.contrib.auth.backends.ModelBackend']):
errors.append(
checks.Error(
"'%s.%s' must be unique because it is named as the 'USERNAME_FIELD'." % (
diff --git a/django/contrib/auth/tests/settings.py b/django/contrib/auth/tests/settings.py
index ce2aa7d152..b3e1eff156 100644
--- a/django/contrib/auth/tests/settings.py
+++ b/django/contrib/auth/tests/settings.py
@@ -3,19 +3,19 @@ import os
from django.utils._os import upath
-AUTH_MIDDLEWARE_CLASSES = (
+AUTH_MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
-)
+]
AUTH_TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path.dirname(upath(__file__)), 'templates')],
'APP_DIRS': True,
'OPTIONS': {
- 'context_processors': (
+ 'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
- ),
+ ],
},
}]
diff --git a/django/contrib/auth/tests/test_auth_backends.py b/django/contrib/auth/tests/test_auth_backends.py
index d3b6c5de0c..73fabe11b0 100644
--- a/django/contrib/auth/tests/test_auth_backends.py
+++ b/django/contrib/auth/tests/test_auth_backends.py
@@ -10,7 +10,7 @@ from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.contrib.auth import authenticate, BACKEND_SESSION_KEY, get_user
from django.http import HttpRequest
-from django.test import TestCase, override_settings
+from django.test import TestCase, modify_settings, override_settings
from django.contrib.auth.hashers import MD5PasswordHasher
@@ -34,8 +34,8 @@ class BaseModelBackendTest(object):
backend = 'django.contrib.auth.backends.ModelBackend'
def setUp(self):
- self.curr_auth = settings.AUTHENTICATION_BACKENDS
- settings.AUTHENTICATION_BACKENDS = (self.backend,)
+ self.curr_auth = list(settings.AUTHENTICATION_BACKENDS)
+ settings.AUTHENTICATION_BACKENDS = [self.backend]
self.create_users()
def tearDown(self):
@@ -172,7 +172,7 @@ class BaseModelBackendTest(object):
user = self.UserModel._default_manager.get(pk=self.superuser.pk)
self.assertEqual(len(user.get_all_permissions()), len(Permission.objects.all()))
- @override_settings(PASSWORD_HASHERS=('django.contrib.auth.tests.test_auth_backends.CountingMD5PasswordHasher',))
+ @override_settings(PASSWORD_HASHERS=['django.contrib.auth.tests.test_auth_backends.CountingMD5PasswordHasher'])
def test_authentication_timing(self):
"""Hasher is run once regardless of whether the user exists. Refs #20760."""
# Re-set the password, because this tests overrides PASSWORD_HASHERS
@@ -337,21 +337,20 @@ class SimpleRowlevelBackend(object):
@skipIfCustomUser
+@modify_settings(AUTHENTICATION_BACKENDS={
+ 'append': 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend',
+})
class RowlevelBackendTest(TestCase):
"""
Tests for auth backend that supports object level permissions
"""
- backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
def setUp(self):
- self.curr_auth = settings.AUTHENTICATION_BACKENDS
- settings.AUTHENTICATION_BACKENDS = tuple(self.curr_auth) + (self.backend,)
self.user1 = User.objects.create_user('test', 'test@example.com', 'test')
self.user2 = User.objects.create_user('test2', 'test2@example.com', 'test')
self.user3 = User.objects.create_user('test3', 'test3@example.com', 'test')
def tearDown(self):
- settings.AUTHENTICATION_BACKENDS = self.curr_auth
# The get_group_permissions test messes with ContentTypes, which will
# be cached; flush the cache to ensure there are no side effects
# Refs #14975, #14925
@@ -377,21 +376,17 @@ class RowlevelBackendTest(TestCase):
self.assertEqual(self.user3.get_group_permissions(TestObj()), {'group_perm'})
+@override_settings(
+ AUTHENTICATION_BACKENDS=['django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'],
+)
class AnonymousUserBackendTest(TestCase):
"""
Tests for AnonymousUser delegating to backend.
"""
- backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
-
def setUp(self):
- self.curr_auth = settings.AUTHENTICATION_BACKENDS
- settings.AUTHENTICATION_BACKENDS = (self.backend,)
self.user1 = AnonymousUser()
- def tearDown(self):
- settings.AUTHENTICATION_BACKENDS = self.curr_auth
-
def test_has_perm(self):
self.assertEqual(self.user1.has_perm('perm', TestObj()), False)
self.assertEqual(self.user1.has_perm('anon', TestObj()), True)
@@ -422,22 +417,17 @@ class NoBackendsTest(TestCase):
@skipIfCustomUser
+@override_settings(AUTHENTICATION_BACKENDS=['django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'])
class InActiveUserBackendTest(TestCase):
"""
Tests for an inactive user
"""
- backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
def setUp(self):
- self.curr_auth = settings.AUTHENTICATION_BACKENDS
- settings.AUTHENTICATION_BACKENDS = (self.backend,)
self.user1 = User.objects.create_user('test', 'test@example.com', 'test')
self.user1.is_active = False
self.user1.save()
- def tearDown(self):
- settings.AUTHENTICATION_BACKENDS = self.curr_auth
-
def test_has_perm(self):
self.assertEqual(self.user1.has_perm('perm', TestObj()), False)
self.assertEqual(self.user1.has_perm('inactive', TestObj()), True)
@@ -476,19 +466,16 @@ class PermissionDeniedBackendTest(TestCase):
self.user1 = User.objects.create_user('test', 'test@example.com', 'test')
self.user1.save()
- @override_settings(AUTHENTICATION_BACKENDS=(backend, ) +
- tuple(settings.AUTHENTICATION_BACKENDS))
+ @modify_settings(AUTHENTICATION_BACKENDS={'prepend': backend})
def test_permission_denied(self):
"user is not authenticated after a backend raises permission denied #2550"
self.assertEqual(authenticate(username='test', password='test'), None)
- @override_settings(AUTHENTICATION_BACKENDS=tuple(
- settings.AUTHENTICATION_BACKENDS) + (backend, ))
+ @modify_settings(AUTHENTICATION_BACKENDS={'append': backend})
def test_authenticates(self):
self.assertEqual(authenticate(username='test', password='test'), self.user1)
- @override_settings(AUTHENTICATION_BACKENDS=(backend, ) +
- tuple(settings.AUTHENTICATION_BACKENDS))
+ @modify_settings(AUTHENTICATION_BACKENDS={'prepend': backend})
def test_has_perm_denied(self):
content_type = ContentType.objects.get_for_model(Group)
perm = Permission.objects.create(name='test', content_type=content_type, codename='test')
@@ -497,8 +484,7 @@ class PermissionDeniedBackendTest(TestCase):
self.assertIs(self.user1.has_perm('auth.test'), False)
self.assertIs(self.user1.has_module_perms('auth'), False)
- @override_settings(AUTHENTICATION_BACKENDS=tuple(
- settings.AUTHENTICATION_BACKENDS) + (backend, ))
+ @modify_settings(AUTHENTICATION_BACKENDS={'append': backend})
def test_has_perm(self):
content_type = ContentType.objects.get_for_model(Group)
perm = Permission.objects.create(name='test', content_type=content_type, codename='test')
@@ -528,7 +514,7 @@ class ChangedBackendSettingsTest(TestCase):
self.TEST_EMAIL,
self.TEST_PASSWORD)
- @override_settings(AUTHENTICATION_BACKENDS=(backend, ))
+ @override_settings(AUTHENTICATION_BACKENDS=[backend])
def test_changed_backend_settings(self):
"""
Tests that removing a backend configured in AUTHENTICATION_BACKENDS
@@ -546,8 +532,8 @@ class ChangedBackendSettingsTest(TestCase):
request.session = self.client.session
# Remove NewModelBackend
- with self.settings(AUTHENTICATION_BACKENDS=(
- 'django.contrib.auth.backends.ModelBackend',)):
+ with self.settings(AUTHENTICATION_BACKENDS=[
+ 'django.contrib.auth.backends.ModelBackend']):
# Get the user from the request
user = get_user(request)
@@ -581,7 +567,7 @@ class TypeErrorBackendTest(TestCase):
def setUp(self):
self.user1 = User.objects.create_user('test', 'test@example.com', 'test')
- @override_settings(AUTHENTICATION_BACKENDS=(backend, ))
+ @override_settings(AUTHENTICATION_BACKENDS=[backend])
def test_type_error_raised(self):
self.assertRaises(TypeError, authenticate, username='test', password='test')
@@ -622,7 +608,7 @@ class ImportedBackendTests(TestCase):
backend = 'django.contrib.auth.tests.backend_alias.ImportedModelBackend'
- @override_settings(AUTHENTICATION_BACKENDS=(backend, ))
+ @override_settings(AUTHENTICATION_BACKENDS=[backend])
def test_backend_path(self):
username = 'username'
password = 'password'
diff --git a/django/contrib/auth/tests/test_context_processors.py b/django/contrib/auth/tests/test_context_processors.py
index f96eac9db7..2f7e5ab4b2 100644
--- a/django/contrib/auth/tests/test_context_processors.py
+++ b/django/contrib/auth/tests/test_context_processors.py
@@ -60,7 +60,7 @@ class PermWrapperTests(TestCase):
@skipIfCustomUser
@override_settings(
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='django.contrib.auth.tests.urls',
TEMPLATES=AUTH_TEMPLATES,
USE_TZ=False, # required for loading the fixture
diff --git a/django/contrib/auth/tests/test_forms.py b/django/contrib/auth/tests/test_forms.py
index 93ce9ad073..601c0868d7 100644
--- a/django/contrib/auth/tests/test_forms.py
+++ b/django/contrib/auth/tests/test_forms.py
@@ -21,7 +21,7 @@ from .utils import skipIfCustomUser
@skipIfCustomUser
-@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
+@override_settings(USE_TZ=False, PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'])
class UserCreationFormTest(TestCase):
fixtures = ['authtestdata.json']
@@ -89,7 +89,7 @@ class UserCreationFormTest(TestCase):
@skipIfCustomUser
-@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
+@override_settings(USE_TZ=False, PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'])
class AuthenticationFormTest(TestCase):
fixtures = ['authtestdata.json']
@@ -202,7 +202,7 @@ class AuthenticationFormTest(TestCase):
@skipIfCustomUser
-@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
+@override_settings(USE_TZ=False, PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'])
class SetPasswordFormTest(TestCase):
fixtures = ['authtestdata.json']
@@ -230,7 +230,7 @@ class SetPasswordFormTest(TestCase):
@skipIfCustomUser
-@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
+@override_settings(USE_TZ=False, PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'])
class PasswordChangeFormTest(TestCase):
fixtures = ['authtestdata.json']
@@ -279,7 +279,7 @@ class PasswordChangeFormTest(TestCase):
@skipIfCustomUser
-@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
+@override_settings(USE_TZ=False, PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'])
class UserChangeFormTest(TestCase):
fixtures = ['authtestdata.json']
@@ -359,7 +359,7 @@ class UserChangeFormTest(TestCase):
@skipIfCustomUser
@override_settings(
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
TEMPLATES=AUTH_TEMPLATES,
USE_TZ=False,
)
diff --git a/django/contrib/auth/tests/test_remote_user.py b/django/contrib/auth/tests/test_remote_user.py
index 790e5d0d53..4e6f86fd0c 100644
--- a/django/contrib/auth/tests/test_remote_user.py
+++ b/django/contrib/auth/tests/test_remote_user.py
@@ -23,10 +23,15 @@ class RemoteUserTest(TestCase):
known_user2 = 'knownuser2'
def setUp(self):
- self.curr_middleware = settings.MIDDLEWARE_CLASSES
- self.curr_auth = settings.AUTHENTICATION_BACKENDS
- settings.MIDDLEWARE_CLASSES += (self.middleware,)
- settings.AUTHENTICATION_BACKENDS += (self.backend,)
+ self.curr_middleware = list(settings.MIDDLEWARE_CLASSES)
+ self.curr_auth = list(settings.AUTHENTICATION_BACKENDS)
+ settings.MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES + [self.middleware]
+ settings.AUTHENTICATION_BACKENDS = settings.AUTHENTICATION_BACKENDS + [self.backend]
+
+ def tearDown(self):
+ """Restores settings to avoid breaking other tests."""
+ settings.MIDDLEWARE_CLASSES = self.curr_middleware
+ settings.AUTHENTICATION_BACKENDS = self.curr_auth
def test_no_remote_user(self):
"""
@@ -143,11 +148,6 @@ class RemoteUserTest(TestCase):
# In backends that do not create new users, it is '' (anonymous user)
self.assertNotEqual(response.context['user'].username, 'knownuser')
- def tearDown(self):
- """Restores settings to avoid breaking other tests."""
- settings.MIDDLEWARE_CLASSES = self.curr_middleware
- settings.AUTHENTICATION_BACKENDS = self.curr_auth
-
class RemoteUserNoCreateBackend(RemoteUserBackend):
"""Backend that doesn't create unknown users."""
diff --git a/django/contrib/auth/tests/test_signals.py b/django/contrib/auth/tests/test_signals.py
index 04c5b89e0b..e3c89f2366 100644
--- a/django/contrib/auth/tests/test_signals.py
+++ b/django/contrib/auth/tests/test_signals.py
@@ -8,7 +8,7 @@ from django.test import override_settings
@skipIfCustomUser
@override_settings(USE_TZ=False,
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='django.contrib.auth.tests.urls')
class SignalTestCase(TestCase):
fixtures = ['authtestdata.json']
diff --git a/django/contrib/auth/tests/test_templates.py b/django/contrib/auth/tests/test_templates.py
index e2bb466d68..409a1705f3 100644
--- a/django/contrib/auth/tests/test_templates.py
+++ b/django/contrib/auth/tests/test_templates.py
@@ -14,7 +14,7 @@ from django.utils.http import urlsafe_base64_encode
@skipIfCustomUser
@override_settings(
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='django.contrib.auth.tests.urls',
)
class AuthTemplateTests(TestCase):
diff --git a/django/contrib/auth/tests/test_views.py b/django/contrib/auth/tests/test_views.py
index e5538517d0..fd01909c2b 100644
--- a/django/contrib/auth/tests/test_views.py
+++ b/django/contrib/auth/tests/test_views.py
@@ -22,7 +22,9 @@ from django.utils.encoding import force_text
from django.utils.http import urlquote
from django.utils.six.moves.urllib.parse import urlparse, ParseResult
from django.utils.translation import LANGUAGE_SESSION_KEY
-from django.test import TestCase, ignore_warnings, override_settings
+from django.test import (
+ TestCase, ignore_warnings, modify_settings, override_settings,
+)
from django.test.utils import patch_logger
from django.middleware.csrf import CsrfViewMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
@@ -34,13 +36,13 @@ from .utils import skipIfCustomUser
@override_settings(
- LANGUAGES=(
+ LANGUAGES=[
('en', 'English'),
- ),
+ ],
LANGUAGE_CODE='en',
TEMPLATES=AUTH_TEMPLATES,
USE_TZ=False,
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='django.contrib.auth.tests.urls',
)
class AuthViewsTestCase(TestCase):
@@ -444,9 +446,9 @@ class ChangePasswordTest(AuthViewsTestCase):
self.assertURLEqual(response.url, '/password_reset/')
-@override_settings(MIDDLEWARE_CLASSES=list(settings.MIDDLEWARE_CLASSES) + [
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware'
-])
+@modify_settings(MIDDLEWARE_CLASSES={
+ 'append': 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
+})
class SessionAuthenticationTests(AuthViewsTestCase):
def test_user_password_change_updates_session(self):
"""
@@ -815,14 +817,14 @@ class LogoutTest(AuthViewsTestCase):
self.assertEqual(self.client.session[LANGUAGE_SESSION_KEY], 'pl')
+# Redirect in test_user_change_password will fail if session auth hash
+# isn't updated after password change (#21649)
@skipIfCustomUser
+@modify_settings(MIDDLEWARE_CLASSES={
+ 'append': 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
+})
@override_settings(
- # Redirect in test_user_change_password will fail if session auth hash
- # isn't updated after password change (#21649)
- MIDDLEWARE_CLASSES=list(settings.MIDDLEWARE_CLASSES) + [
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware'
- ],
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='django.contrib.auth.tests.urls_admin',
)
class ChangelistTests(AuthViewsTestCase):
diff --git a/django/contrib/flatpages/tests/test_csrf.py b/django/contrib/flatpages/tests/test_csrf.py
index 7b35f621fd..b9d7f32327 100644
--- a/django/contrib/flatpages/tests/test_csrf.py
+++ b/django/contrib/flatpages/tests/test_csrf.py
@@ -8,14 +8,14 @@ from .settings import FLATPAGES_TEMPLATES
@override_settings(
LOGIN_URL='/accounts/login/',
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
- ),
+ ],
ROOT_URLCONF='django.contrib.flatpages.tests.urls',
CSRF_FAILURE_VIEW='django.views.csrf.csrf_failure',
TEMPLATES=FLATPAGES_TEMPLATES,
diff --git a/django/contrib/flatpages/tests/test_forms.py b/django/contrib/flatpages/tests/test_forms.py
index 8a6db742fa..09f500c6ae 100644
--- a/django/contrib/flatpages/tests/test_forms.py
+++ b/django/contrib/flatpages/tests/test_forms.py
@@ -37,7 +37,7 @@ class FlatpageAdminFormTests(TestCase):
self.assertEqual(form.errors['url'], ["URL is missing a leading slash."])
@override_settings(APPEND_SLASH=True,
- MIDDLEWARE_CLASSES=('django.middleware.common.CommonMiddleware',))
+ MIDDLEWARE_CLASSES=['django.middleware.common.CommonMiddleware'])
def test_flatpage_requires_trailing_slash_with_append_slash(self):
form = FlatpageForm(data=dict(url='/no_trailing_slash', **self.form_data))
with translation.override('en'):
@@ -45,7 +45,7 @@ class FlatpageAdminFormTests(TestCase):
self.assertEqual(form.errors['url'], ["URL is missing a trailing slash."])
@override_settings(APPEND_SLASH=False,
- MIDDLEWARE_CLASSES=('django.middleware.common.CommonMiddleware',))
+ MIDDLEWARE_CLASSES=['django.middleware.common.CommonMiddleware'])
def test_flatpage_doesnt_requires_trailing_slash_without_append_slash(self):
form = FlatpageForm(data=dict(url='/no_trailing_slash', **self.form_data))
self.assertTrue(form.is_valid())
diff --git a/django/contrib/flatpages/tests/test_middleware.py b/django/contrib/flatpages/tests/test_middleware.py
index 0e8415b075..f132aa07ac 100644
--- a/django/contrib/flatpages/tests/test_middleware.py
+++ b/django/contrib/flatpages/tests/test_middleware.py
@@ -9,14 +9,14 @@ from .settings import FLATPAGES_TEMPLATES
@override_settings(
LOGIN_URL='/accounts/login/',
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
- ),
+ ],
ROOT_URLCONF='django.contrib.flatpages.tests.urls',
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
@@ -87,14 +87,14 @@ class FlatpageMiddlewareTests(TestCase):
@override_settings(
APPEND_SLASH=True,
LOGIN_URL='/accounts/login/',
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
- ),
+ ],
ROOT_URLCONF='django.contrib.flatpages.tests.urls',
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
diff --git a/django/contrib/flatpages/tests/test_templatetags.py b/django/contrib/flatpages/tests/test_templatetags.py
index f771adbafb..a4a65ce840 100644
--- a/django/contrib/flatpages/tests/test_templatetags.py
+++ b/django/contrib/flatpages/tests/test_templatetags.py
@@ -7,14 +7,14 @@ from .settings import FLATPAGES_TEMPLATES
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
- ),
+ ],
ROOT_URLCONF='django.contrib.flatpages.tests.urls',
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
diff --git a/django/contrib/flatpages/tests/test_views.py b/django/contrib/flatpages/tests/test_views.py
index b6fb25f9c3..26c071c311 100644
--- a/django/contrib/flatpages/tests/test_views.py
+++ b/django/contrib/flatpages/tests/test_views.py
@@ -9,14 +9,14 @@ from .settings import FLATPAGES_TEMPLATES
@override_settings(
LOGIN_URL='/accounts/login/',
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# no 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
- ),
+ ],
ROOT_URLCONF='django.contrib.flatpages.tests.urls',
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
@@ -75,14 +75,14 @@ class FlatpageViewTests(TestCase):
@override_settings(
APPEND_SLASH=True,
LOGIN_URL='/accounts/login/',
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# no 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
- ),
+ ],
ROOT_URLCONF='django.contrib.flatpages.tests.urls',
TEMPLATES=FLATPAGES_TEMPLATES,
SITE_ID=1,
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index af31402f66..4e46c66114 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -283,7 +283,7 @@ class Command(BaseCommand):
self.default_locale_path = self.locale_paths[0]
self.invoked_for_django = True
else:
- self.locale_paths.extend(list(settings.LOCALE_PATHS))
+ self.locale_paths.extend(settings.LOCALE_PATHS)
# Allow to run makemessages inside an app dir
if os.path.isdir('locale'):
self.locale_paths.append(os.path.abspath('locale'))
diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py
index ecaf84a035..aa0a34ef40 100644
--- a/django/templatetags/i18n.py
+++ b/django/templatetags/i18n.py
@@ -231,7 +231,7 @@ def do_get_language_info_list(parser, token):
"""
This will store a list of language information dictionaries for the given
language codes in a context variable. The language codes can be specified
- either as a list of strings or a settings.LANGUAGES style tuple (or any
+ either as a list of strings or a settings.LANGUAGES style list (or any
sequence of sequences whose first items are language codes).
Usage::
diff --git a/django/utils/formats.py b/django/utils/formats.py
index afbe5da12c..855b1a1cc0 100644
--- a/django/utils/formats.py
+++ b/django/utils/formats.py
@@ -20,14 +20,14 @@ _format_cache = {}
_format_modules_cache = {}
ISO_INPUT_FORMATS = {
- 'DATE_INPUT_FORMATS': ('%Y-%m-%d',),
- 'TIME_INPUT_FORMATS': ('%H:%M:%S', '%H:%M:%S.%f', '%H:%M'),
- 'DATETIME_INPUT_FORMATS': (
+ 'DATE_INPUT_FORMATS': ['%Y-%m-%d'],
+ 'TIME_INPUT_FORMATS': ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'],
+ 'DATETIME_INPUT_FORMATS': [
'%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d'
- ),
+ ],
}
diff --git a/django/views/i18n.py b/django/views/i18n.py
index 8ec2ccab90..7278f6ce1b 100644
--- a/django/views/i18n.py
+++ b/django/views/i18n.py
@@ -205,7 +205,7 @@ def get_javascript_catalog(locale, domain, packages):
path = os.path.join(os.path.dirname(upath(p.__file__)), 'locale')
paths.append(path)
# add the filesystem paths listed in the LOCALE_PATHS setting
- paths.extend(list(reversed(settings.LOCALE_PATHS)))
+ paths.extend(reversed(settings.LOCALE_PATHS))
# first load all english languages files for defaults
for path in paths:
try:
diff --git a/docs/howto/auth-remote-user.txt b/docs/howto/auth-remote-user.txt
index 07389c1fac..53ed929511 100644
--- a/docs/howto/auth-remote-user.txt
+++ b/docs/howto/auth-remote-user.txt
@@ -31,20 +31,20 @@ First, you must add the
:setting:`MIDDLEWARE_CLASSES` setting **after** the
:class:`django.contrib.auth.middleware.AuthenticationMiddleware`::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
'...',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.RemoteUserMiddleware',
'...',
- )
+ ]
Next, you must replace the :class:`~django.contrib.auth.backends.ModelBackend`
with :class:`~django.contrib.auth.backends.RemoteUserBackend` in the
:setting:`AUTHENTICATION_BACKENDS` setting::
- AUTHENTICATION_BACKENDS = (
+ AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.RemoteUserBackend',
- )
+ ]
With this setup, ``RemoteUserMiddleware`` will detect the username in
``request.META['REMOTE_USER']`` and will authenticate and auto-login that user
diff --git a/docs/howto/error-reporting.txt b/docs/howto/error-reporting.txt
index 521acf59d3..e71419ba37 100644
--- a/docs/howto/error-reporting.txt
+++ b/docs/howto/error-reporting.txt
@@ -73,14 +73,14 @@ those are usually just people typing in broken URLs or broken Web 'bots).
Put it towards the top of your :setting:`MIDDLEWARE_CLASSES` setting.
You can tell Django to stop reporting particular 404s by tweaking the
-:setting:`IGNORABLE_404_URLS` setting. It should be a tuple of compiled
+:setting:`IGNORABLE_404_URLS` setting. It should be a list of compiled
regular expression objects. For example::
import re
- IGNORABLE_404_URLS = (
+ IGNORABLE_404_URLS = [
re.compile(r'\.(php|cgi)$'),
re.compile(r'^/phpmyadmin/'),
- )
+ ]
In this example, a 404 to any URL ending with ``.php`` or ``.cgi`` will *not* be
reported. Neither will any URL starting with ``/phpmyadmin/``.
@@ -89,11 +89,11 @@ The following example shows how to exclude some conventional URLs that browsers
crawlers often request::
import re
- IGNORABLE_404_URLS = (
+ IGNORABLE_404_URLS = [
re.compile(r'^/apple-touch-icon.*\.png$'),
re.compile(r'^/favicon\.ico$'),
re.compile(r'^/robots\.txt$'),
- )
+ ]
(Note that these are regular expressions, so we put a backslash in front of
periods to escape them.)
diff --git a/docs/howto/static-files/index.txt b/docs/howto/static-files/index.txt
index f9fd390ef0..3185b5fdca 100644
--- a/docs/howto/static-files/index.txt
+++ b/docs/howto/static-files/index.txt
@@ -55,10 +55,10 @@ particular app. In addition to using a ``static/`` directory inside your apps,
you can define a list of directories (:setting:`STATICFILES_DIRS`) in your
settings file where Django will also look for static files. For example::
- STATICFILES_DIRS = (
+ STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
'/var/www/static/',
- )
+ ]
See the documentation for the :setting:`STATICFILES_FINDERS` setting for
details on how ``staticfiles`` finds your files.
diff --git a/docs/internals/contributing/writing-documentation.txt b/docs/internals/contributing/writing-documentation.txt
index a08d07eae5..5c8da281ac 100644
--- a/docs/internals/contributing/writing-documentation.txt
+++ b/docs/internals/contributing/writing-documentation.txt
@@ -312,14 +312,14 @@ example:
ADMINS
------
- Default: ``()`` (Empty tuple)
+ Default: ``[]`` (Empty list)
- A tuple that lists people who get code error notifications. When
+ A list of all the people who get code error notifications. When
``DEBUG=False`` and a view raises an exception, Django will email these people
- with the full exception information. Each member of the tuple should be a tuple
+ with the full exception information. Each member of the list should be a tuple
of (Full name, email address). Example::
- (('John', 'john@example.com'), ('Mary', 'mary@example.com'))
+ [('John', 'john@example.com'), ('Mary', 'mary@example.com')]
Note that Django will email *all* of these people whenever an error happens.
See :doc:`/howto/error-reporting` for more information.
diff --git a/docs/intro/reusable-apps.txt b/docs/intro/reusable-apps.txt
index 3c8041e857..d20bd37210 100644
--- a/docs/intro/reusable-apps.txt
+++ b/docs/intro/reusable-apps.txt
@@ -159,10 +159,10 @@ this. For a small app like polls, this process isn't too difficult.
1. Add "polls" to your INSTALLED_APPS setting like this::
- INSTALLED_APPS = (
+ INSTALLED_APPS = [
...
'polls',
- )
+ ]
2. Include the polls URLconf in your project urls.py like this::
diff --git a/docs/intro/tutorial01.txt b/docs/intro/tutorial01.txt
index 5d4eaca76c..bfce99de0b 100644
--- a/docs/intro/tutorial01.txt
+++ b/docs/intro/tutorial01.txt
@@ -422,7 +422,7 @@ look like this:
.. snippet::
:filename: mysite/settings.py
- INSTALLED_APPS = (
+ INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -430,7 +430,7 @@ look like this:
'django.contrib.messages',
'django.contrib.staticfiles',
'polls',
- )
+ ]
Now Django knows to include the ``polls`` app. Let's run another command:
diff --git a/docs/ref/clickjacking.txt b/docs/ref/clickjacking.txt
index 5ce26ba43b..b7ba915eee 100644
--- a/docs/ref/clickjacking.txt
+++ b/docs/ref/clickjacking.txt
@@ -55,11 +55,11 @@ To set the same ``X-Frame-Options`` value for all responses in your site, put
``'django.middleware.clickjacking.XFrameOptionsMiddleware'`` to
:setting:`MIDDLEWARE_CLASSES`::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
...
'django.middleware.clickjacking.XFrameOptionsMiddleware',
...
- )
+ ]
This middleware is enabled in the settings file generated by
:djadmin:`startproject`.
diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt
index eb11721c12..05f3c8360b 100644
--- a/docs/ref/contrib/gis/tutorial.txt
+++ b/docs/ref/contrib/gis/tutorial.txt
@@ -114,7 +114,7 @@ In addition, modify the :setting:`INSTALLED_APPS` setting to include
:mod:`django.contrib.admin`, :mod:`django.contrib.gis`,
and ``world`` (your newly created application)::
- INSTALLED_APPS = (
+ INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -123,7 +123,7 @@ and ``world`` (your newly created application)::
'django.contrib.staticfiles',
'django.contrib.gis',
'world'
- )
+ ]
Geographic Data
===============
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 9570b81aac..0218a6ef58 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -9,7 +9,7 @@ Settings
.. warning::
Be careful when you override settings, especially when the default value
- is a non-empty tuple or dictionary, such as :setting:`MIDDLEWARE_CLASSES`
+ is a non-empty list or dictionary, such as :setting:`MIDDLEWARE_CLASSES`
and :setting:`STATICFILES_FINDERS`. Make sure you keep the components
required by the features of Django you wish to use.
@@ -45,14 +45,14 @@ of the case of the actual model class name.
ADMINS
------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
-A tuple that lists people who get code error notifications. When
+A list of all the people who get code error notifications. When
``DEBUG=False`` and a view raises an exception, Django will email these people
-with the full exception information. Each member of the tuple should be a tuple
+with the full exception information. Each item in the list should be a tuple
of (Full name, email address). Example::
- (('John', 'john@example.com'), ('Mary', 'mary@example.com'))
+ [('John', 'john@example.com'), ('Mary', 'mary@example.com')]
Note that Django will email *all* of these people whenever an error happens.
See :doc:`/howto/error-reporting` for more information.
@@ -104,7 +104,7 @@ are bypassing this security protection.
ALLOWED_INCLUDE_ROOTS
---------------------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
.. deprecated:: 1.8
@@ -117,11 +117,11 @@ Default: ``()`` (Empty tuple)
:setting:`OPTIONS <TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend
instead.
-A tuple of strings representing allowed prefixes for the ``{% ssi %}`` template
+A list of strings representing allowed prefixes for the ``{% ssi %}`` template
tag. This is a security measure, so that template authors can't access files
that they shouldn't be accessing.
-For example, if :setting:`ALLOWED_INCLUDE_ROOTS` is ``('/home/html', '/var/www')``,
+For example, if :setting:`ALLOWED_INCLUDE_ROOTS` is ``['/home/html', '/var/www']``,
then ``{% ssi /home/html/foo.txt %}`` would work, but ``{% ssi /etc/passwd %}``
wouldn't.
@@ -853,15 +853,15 @@ DATE_INPUT_FORMATS
Default::
- (
+ [
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
- )
+ ]
-A tuple of formats that will be accepted when inputting data on a date field.
+A list of formats that will be accepted when inputting data on a date field.
Formats will be tried in order, using the first valid one. Note that these
format strings use Python's datetime_ module syntax, not the format strings
from the ``date`` Django template tag.
@@ -894,7 +894,7 @@ DATETIME_INPUT_FORMATS
Default::
- (
+ [
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
@@ -907,9 +907,9 @@ Default::
'%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
- )
+ ]
-A tuple of formats that will be accepted when inputting data on a datetime
+A list of formats that will be accepted when inputting data on a datetime
field. Formats will be tried in order, using the first valid one. Note that
these format strings use Python's datetime_ module syntax, not the format
strings from the ``date`` Django template tag.
@@ -1076,7 +1076,7 @@ backend supports it (see :doc:`/topics/db/tablespaces`).
DISALLOWED_USER_AGENTS
----------------------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
List of compiled regular expression objects representing User-Agent strings that
are not allowed to visit any page, systemwide. Use this for bad robots/crawlers.
@@ -1247,10 +1247,10 @@ FILE_UPLOAD_HANDLERS
Default::
- ("django.core.files.uploadhandler.MemoryFileUploadHandler",
- "django.core.files.uploadhandler.TemporaryFileUploadHandler")
+ ["django.core.files.uploadhandler.MemoryFileUploadHandler",
+ "django.core.files.uploadhandler.TemporaryFileUploadHandler"]
-A tuple of handlers to use for uploading. Changing this setting allows complete
+A list of handlers to use for uploading. Changing this setting allows complete
customization -- even replacement -- of Django's upload process.
See :doc:`/topics/files` for details.
@@ -1349,7 +1349,7 @@ Monday and so on.
FIXTURE_DIRS
-------------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
List of directories searched for fixture files, in addition to the
``fixtures`` directory of each application, in search order.
@@ -1419,7 +1419,7 @@ Available formats are :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`,
IGNORABLE_404_URLS
------------------
-Default: ``()``
+Default: ``[]`` (Empty list)
List of compiled regular expression objects describing URLs that should be
ignored when reporting HTTP 404 errors via email (see
@@ -1438,9 +1438,9 @@ This is only used if
INSTALLED_APPS
--------------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
-A tuple of strings designating all applications that are enabled in this
+A list of strings designating all applications that are enabled in this
Django installation. Each string should be a dotted Python path to:
* an application configuration class, or
@@ -1479,9 +1479,9 @@ listed first in :setting:`INSTALLED_APPS` has precedence.
INTERNAL_IPS
------------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
-A tuple of IP addresses, as strings, that:
+A list of IP addresses, as strings, that:
* See debug comments, when :setting:`DEBUG` is ``True``
* Receive X headers in admindocs if the ``XViewMiddleware`` is installed (see
@@ -1581,14 +1581,14 @@ deletes the one.
LANGUAGES
---------
-Default: A tuple of all available languages. This list is continually growing
+Default: A list of all available languages. This list is continually growing
and including a copy here would inevitably become rapidly out of date. You can
see the current list of translated languages by looking in
``django/conf/global_settings.py`` (or view the `online source`_).
.. _online source: https://github.com/django/django/blob/master/django/conf/global_settings.py
-The list is a tuple of two-tuples in the format
+The list is a list of two-tuples in the format
(:term:`language code<language code>`, ``language name``) -- for example,
``('ja', 'Japanese')``.
This specifies which languages are available for language selection. See
@@ -1605,27 +1605,27 @@ Here's a sample settings file::
from django.utils.translation import ugettext_lazy as _
- LANGUAGES = (
+ LANGUAGES = [
('de', _('German')),
('en', _('English')),
- )
+ ]
.. setting:: LOCALE_PATHS
LOCALE_PATHS
------------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
-A tuple of directories where Django looks for translation files.
+A list of directories where Django looks for translation files.
See :ref:`how-django-discovers-translations`.
Example::
- LOCALE_PATHS = (
+ LOCALE_PATHS = [
'/home/www/project/common_files/locale',
'/var/local/translations/locale',
- )
+ ]
Django will look within each of these paths for the ``<locale_code>/LC_MESSAGES``
directories containing the actual translation files.
@@ -1671,9 +1671,9 @@ configuration process will be skipped.
MANAGERS
--------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
-A tuple in the same format as :setting:`ADMINS` that specifies who should get
+A list in the same format as :setting:`ADMINS` that specifies who should get
broken link notifications when
:class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled.
@@ -1735,10 +1735,10 @@ MIDDLEWARE_CLASSES
Default::
- ('django.middleware.common.CommonMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware')
+ ['django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware']
-A tuple of middleware classes to use. See :doc:`/topics/http/middleware`.
+A list of middleware classes to use. See :doc:`/topics/http/middleware`.
.. setting:: MIGRATION_MODULES
@@ -2220,20 +2220,20 @@ TEMPLATE_CONTEXT_PROCESSORS
Default::
- ("django.contrib.auth.context_processors.auth",
+ ["django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.tz",
- "django.contrib.messages.context_processors.messages")
+ "django.contrib.messages.context_processors.messages"]
.. deprecated:: 1.8
Set the ``'context_processors'`` option in the :setting:`OPTIONS
<TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend instead.
-A tuple of callables that are used to populate the context in ``RequestContext``.
+A list of callables that are used to populate the context in ``RequestContext``.
These callables take a request object as their argument and return a dictionary
of items to be merged into the context.
@@ -2265,7 +2265,7 @@ See also :setting:`DEBUG`.
TEMPLATE_DIRS
-------------
-Default: ``()`` (Empty tuple)
+Default: ``[]`` (Empty list)
.. deprecated:: 1.8
@@ -2286,15 +2286,15 @@ TEMPLATE_LOADERS
Default::
- ('django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader')
+ ['django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader']
.. deprecated:: 1.8
Set the ``'loaders'`` option in the :setting:`OPTIONS <TEMPLATES-OPTIONS>`
of a ``DjangoTemplates`` backend instead.
-A tuple of template loader classes, specified as strings. Each ``Loader`` class
+A list of template loader classes, specified as strings. Each ``Loader`` class
knows how to import templates from a particular source. Optionally, a tuple can be
used instead of a string. The first item in the tuple should be the ``Loader``’s
module, subsequent items are passed to the ``Loader`` during initialization. See
@@ -2381,13 +2381,13 @@ TIME_INPUT_FORMATS
Default::
- (
+ [
'%H:%M:%S', # '14:30:59'
'%H:%M:%S.%f', # '14:30:59.000200'
'%H:%M', # '14:30'
- )
+ ]
-A tuple of formats that will be accepted when inputting data on a time field.
+A list of formats that will be accepted when inputting data on a time field.
Formats will be tried in order, using the first valid one. Note that these
format strings use Python's datetime_ module syntax, not the format strings
from the ``date`` Django template tag.
@@ -2601,9 +2601,9 @@ Settings for :mod:`django.contrib.auth`.
AUTHENTICATION_BACKENDS
-----------------------
-Default: ``('django.contrib.auth.backends.ModelBackend',)``
+Default: ``['django.contrib.auth.backends.ModelBackend']``
-A tuple of authentication backend classes (as strings) to use when attempting to
+A list of authentication backend classes (as strings) to use when attempting to
authenticate a user. See the :ref:`authentication backends documentation
<authentication-backends>` for details.
@@ -2683,13 +2683,13 @@ See :ref:`auth_password_storage`.
Default::
- ('django.contrib.auth.hashers.PBKDF2PasswordHasher',
+ ['django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
- 'django.contrib.auth.hashers.CryptPasswordHasher')
+ 'django.contrib.auth.hashers.CryptPasswordHasher']
.. _settings-messages:
@@ -3029,21 +3029,21 @@ You may need to :ref:`configure these files to be served in development
STATICFILES_DIRS
----------------
-Default: ``[]``
+Default: ``[]`` (Empty list)
This setting defines the additional locations the staticfiles app will traverse
if the ``FileSystemFinder`` finder is enabled, e.g. if you use the
:djadmin:`collectstatic` or :djadmin:`findstatic` management command or use the
static file serving view.
-This should be set to a list or tuple of strings that contain full paths to
+This should be set to a list of strings that contain full paths to
your additional files directory(ies) e.g.::
- STATICFILES_DIRS = (
+ STATICFILES_DIRS = [
"/home/special.polls.com/polls/static",
"/home/polls.com/polls/static",
"/opt/webfiles/common",
- )
+ ]
Note that these paths should use Unix-style forward slashes, even on Windows
(e.g. ``"C:/Users/user/mysite/extra_static_content"``).
@@ -3055,10 +3055,10 @@ In case you want to refer to files in one of the locations with an additional
namespace, you can **optionally** provide a prefix as ``(prefix, path)``
tuples, e.g.::
- STATICFILES_DIRS = (
+ STATICFILES_DIRS = [
# ...
("downloads", "/opt/webfiles/stats"),
- )
+ ]
For example, assuming you have :setting:`STATIC_URL` set to ``'/static/'``, the
:djadmin:`collectstatic` management command would collect the "stats" files
@@ -3094,8 +3094,8 @@ STATICFILES_FINDERS
Default::
- ("django.contrib.staticfiles.finders.FileSystemFinder",
- "django.contrib.staticfiles.finders.AppDirectoriesFinder")
+ ["django.contrib.staticfiles.finders.FileSystemFinder",
+ "django.contrib.staticfiles.finders.AppDirectoriesFinder"]
The list of finder backends that know how to find static files in
various locations.
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index b98d4128ad..0355fb59ed 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -802,7 +802,7 @@ loaders that come with Django:
For example, for this setting::
- INSTALLED_APPS = ('myproject.polls', 'myproject.music')
+ INSTALLED_APPS = ['myproject.polls', 'myproject.music']
...then ``get_template('foo.html')`` will look for ``foo.html`` in these
directories, in this order:
diff --git a/docs/ref/templates/upgrading.txt b/docs/ref/templates/upgrading.txt
index c7b07464b0..02588175d6 100644
--- a/docs/ref/templates/upgrading.txt
+++ b/docs/ref/templates/upgrading.txt
@@ -21,8 +21,8 @@ Here's how to define :setting:`TEMPLATES` in your settings module.
If you're using the default value of ``TEMPLATE_LOADERS``, that is, if it
isn't defined in your settings file or if it's set to::
- ('django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader')
+ ['django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader']
then you should define :setting:`TEMPLATES` as follows::
diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt
index db9b6c324d..0ff65dec7f 100644
--- a/docs/releases/1.9.txt
+++ b/docs/releases/1.9.txt
@@ -176,6 +176,12 @@ Database backend API
doesn't implement this. You may want to review the implementation on the
backends that Django includes for reference (:ticket:`24245`).
+Default settings that were tuples are now lists
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The default settings in ``django.conf.global_settings`` were a combination of
+lists and tuples. All settings that were formerly tuples are now lists.
+
Miscellaneous
~~~~~~~~~~~~~
diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt
index d75b4b6cb8..3833328cf2 100644
--- a/docs/topics/auth/customizing.txt
+++ b/docs/topics/auth/customizing.txt
@@ -52,13 +52,13 @@ all of its authentication backends. If the first authentication method fails,
Django tries the second one, and so on, until all backends have been attempted.
The list of authentication backends to use is specified in the
-:setting:`AUTHENTICATION_BACKENDS` setting. This should be a tuple of Python
+:setting:`AUTHENTICATION_BACKENDS` setting. This should be a list of Python
path names that point to Python classes that know how to authenticate. These
classes can be anywhere on your Python path.
By default, :setting:`AUTHENTICATION_BACKENDS` is set to::
- ('django.contrib.auth.backends.ModelBackend',)
+ ['django.contrib.auth.backends.ModelBackend']
That's the basic authentication backend that checks the Django users database
and queries the built-in permissions. It does not provide protection against
diff --git a/docs/topics/auth/passwords.txt b/docs/topics/auth/passwords.txt
index ee41c4bcdb..910d08fabe 100644
--- a/docs/topics/auth/passwords.txt
+++ b/docs/topics/auth/passwords.txt
@@ -49,7 +49,7 @@ first in the list.
The default for :setting:`PASSWORD_HASHERS` is::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
@@ -57,7 +57,7 @@ The default for :setting:`PASSWORD_HASHERS` is::
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
- )
+ ]
This means that Django will use PBKDF2_ to store all passwords, but will support
checking passwords stored with PBKDF2SHA1, bcrypt_, SHA1_, etc. The next few
@@ -83,7 +83,7 @@ To use Bcrypt as your default storage algorithm, do the following:
2. Modify :setting:`PASSWORD_HASHERS` to list ``BCryptSHA256PasswordHasher``
first. That is, in your settings file, you'd put::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
@@ -91,7 +91,7 @@ To use Bcrypt as your default storage algorithm, do the following:
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
- )
+ ]
(You need to keep the other entries in this list, or else Django won't
be able to upgrade passwords; see below).
@@ -154,7 +154,7 @@ default PBKDF2 algorithm:
2. Add your new hasher as the first entry in :setting:`PASSWORD_HASHERS`::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'myproject.hashers.MyPBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
@@ -163,7 +163,7 @@ default PBKDF2 algorithm:
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
- )
+ ]
That's it -- now your Django install will use more iterations when it
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index d6c5c56f6f..5cdb18e615 100644
--- a/docs/topics/cache.txt
+++ b/docs/topics/cache.txt
@@ -437,11 +437,11 @@ entire site. You'll need to add
``'django.middleware.cache.FetchFromCacheMiddleware'`` to your
:setting:`MIDDLEWARE_CLASSES` setting, as in this example::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
- )
+ ]
.. note::
diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt
index 9decc9ebef..2a9193c805 100644
--- a/docs/topics/db/models.txt
+++ b/docs/topics/db/models.txt
@@ -70,11 +70,11 @@ For example, if the models for your application live in the module
application by the :djadmin:`manage.py startapp <startapp>` script),
:setting:`INSTALLED_APPS` should read, in part::
- INSTALLED_APPS = (
+ INSTALLED_APPS = [
#...
'myapp',
#...
- )
+ ]
When you add new apps to :setting:`INSTALLED_APPS`, be sure to run
:djadmin:`manage.py migrate <migrate>`, optionally making migrations
diff --git a/docs/topics/http/file-uploads.txt b/docs/topics/http/file-uploads.txt
index f07c27679a..ea01dfc88e 100644
--- a/docs/topics/http/file-uploads.txt
+++ b/docs/topics/http/file-uploads.txt
@@ -132,8 +132,8 @@ handler* -- a small class that handles file data as it gets uploaded. Upload
handlers are initially defined in the :setting:`FILE_UPLOAD_HANDLERS` setting,
which defaults to::
- ("django.core.files.uploadhandler.MemoryFileUploadHandler",
- "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
+ ["django.core.files.uploadhandler.MemoryFileUploadHandler",
+ "django.core.files.uploadhandler.TemporaryFileUploadHandler"]
Together :class:`MemoryFileUploadHandler` and
:class:`TemporaryFileUploadHandler` provide Django's default file upload
diff --git a/docs/topics/http/middleware.txt b/docs/topics/http/middleware.txt
index 7e1e01dd87..cd03870c31 100644
--- a/docs/topics/http/middleware.txt
+++ b/docs/topics/http/middleware.txt
@@ -20,21 +20,21 @@ Activating middleware
=====================
To activate a middleware component, add it to the
-:setting:`MIDDLEWARE_CLASSES` tuple in your Django settings.
+:setting:`MIDDLEWARE_CLASSES` list in your Django settings.
In :setting:`MIDDLEWARE_CLASSES`, each middleware component is represented by
a string: the full Python path to the middleware's class name. For example,
here's the default value created by :djadmin:`django-admin startproject
<startproject>`::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
- )
+ ]
A Django installation doesn't require any middleware —
:setting:`MIDDLEWARE_CLASSES` can be empty, if you'd like — but it's strongly
diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt
index 7da54127cf..8eaa248bcb 100644
--- a/docs/topics/i18n/translation.txt
+++ b/docs/topics/i18n/translation.txt
@@ -848,7 +848,7 @@ information for a list of languages (e.g. active languages as specified in
view <set_language-redirect-view>` for an example of how to display a language
selector using ``{% get_language_info_list %}``.
-In addition to :setting:`LANGUAGES` style nested tuples,
+In addition to :setting:`LANGUAGES` style list of tuples,
``{% get_language_info_list %}`` supports simple lists of language codes.
If you do this in your view:
@@ -1684,11 +1684,11 @@ matters, you should follow these guidelines:
For example, your :setting:`MIDDLEWARE_CLASSES` might look like this::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
- )
+ ]
(For more on middleware, see the :doc:`middleware documentation
</topics/http/middleware>`.)
@@ -1734,10 +1734,10 @@ Notes:
languages (because your application doesn't provide all those languages),
set :setting:`LANGUAGES` to a list of languages. For example::
- LANGUAGES = (
+ LANGUAGES = [
('de', _('German')),
('en', _('English')),
- )
+ ]
This example restricts languages that are available for automatic
selection to German and English (and any sublanguage, like de-ch or
@@ -1752,10 +1752,10 @@ Notes:
from django.utils.translation import ugettext_lazy as _
- LANGUAGES = (
+ LANGUAGES = [
('de', _('German')),
('en', _('English')),
- )
+ ]
Once ``LocaleMiddleware`` determines the user's preference, it makes this
preference available as ``request.LANGUAGE_CODE`` for each
diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt
index ac1c4b550e..cee2f2c1fe 100644
--- a/docs/topics/testing/overview.txt
+++ b/docs/topics/testing/overview.txt
@@ -320,9 +320,9 @@ design. If during your tests you are authenticating many users, you may want
to use a custom settings file and set the :setting:`PASSWORD_HASHERS` setting
to a faster hashing algorithm::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
- )
+ ]
Don't forget to also include in :setting:`PASSWORD_HASHERS` any hashing
algorithm used in fixtures, if any.
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py
index 5ee5a512db..16b56aef86 100644
--- a/tests/admin_changelist/tests.py
+++ b/tests/admin_changelist/tests.py
@@ -664,7 +664,7 @@ class AdminLogNodeTestCase(TestCase):
self.assertEqual(template.render(context), '')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_changelist.urls")
class SeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py
index ea3c0704b3..56827c08c4 100644
--- a/tests/admin_custom_urls/tests.py
+++ b/tests/admin_custom_urls/tests.py
@@ -8,7 +8,7 @@ from django.test import TestCase, override_settings
from .models import Action, Person, Car
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_custom_urls.urls',)
class AdminCustomUrlsTest(TestCase):
"""
@@ -80,7 +80,7 @@ class AdminCustomUrlsTest(TestCase):
self.assertContains(response, 'value="path/to/html/document.html"')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_custom_urls.urls',)
class CustomRedirects(TestCase):
fixtures = ['users.json', 'actions.json']
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py
index 2b0f6dc065..5ba0e2a0bc 100644
--- a/tests/admin_docs/tests.py
+++ b/tests/admin_docs/tests.py
@@ -13,7 +13,7 @@ from .models import Person, Company
@override_settings(
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_docs.urls')
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.admindocs'})
class AdminDocsTestCase(TestCase):
diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py
index ed931a0cc1..fe481994d0 100644
--- a/tests/admin_inlines/tests.py
+++ b/tests/admin_inlines/tests.py
@@ -21,7 +21,7 @@ from .models import (Holder, Inner, Holder2, Inner2, Holder3, Inner3, Person,
INLINE_CHANGELINK_HTML = 'class="inlinechangelink">Change</a>'
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_inlines.urls")
class TestInline(TestCase):
fixtures = ['admin-views-users.xml']
@@ -346,7 +346,7 @@ class TestInline(TestCase):
self.assertNotContains(response, INLINE_CHANGELINK_HTML)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_inlines.urls")
class TestInlineMedia(TestCase):
fixtures = ['admin-views-users.xml']
@@ -423,7 +423,7 @@ class TestInlineAdminForm(TestCase):
self.assertEqual(iaf2.original_content_type_id, poll_ct.id)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_inlines.urls")
class TestInlineProtectedOnDelete(TestCase):
fixtures = ['admin-views-users.xml']
@@ -650,7 +650,7 @@ class TestInlinePermissions(TestCase):
self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_inlines.urls")
class SeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 090546c474..de3861d551 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -62,7 +62,7 @@ ERROR_MESSAGE = "Please enter the correct username and password \
for a staff account. Note that both fields may be case-sensitive."
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls",
USE_I18N=True, USE_L10N=False, LANGUAGE_CODE='en')
class AdminViewBasicTestCase(TestCase):
@@ -888,7 +888,7 @@ class AdminCustomTemplateTests(AdminViewBasicTestCase):
self.assertTemplateUsed(response, 'custom_filter_template.html')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewFormUrlTest(TestCase):
fixtures = ["admin-views-users.xml"]
@@ -919,7 +919,7 @@ class AdminViewFormUrlTest(TestCase):
self.assertContains(response, 'value="overridden_value"')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminJavaScriptTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -961,7 +961,7 @@ class AdminJavaScriptTest(TestCase):
self.assertNotContains(response, 'inlines.min.js')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class SaveAsTests(TestCase):
fixtures = ['admin-views-users.xml', 'admin-views-person.xml']
@@ -1074,7 +1074,7 @@ def get_perm(Model, perm):
return Permission.objects.get(content_type=ct, codename=perm)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewPermissionsTest(TestCase):
"""Tests for Admin Views Permissions."""
@@ -1762,7 +1762,7 @@ class AdminViewPermissionsTest(TestCase):
self.client.get('/test_admin/admin7/logout/')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewsNoUrlTest(TestCase):
"""Regression test for #17333"""
@@ -1794,7 +1794,7 @@ class AdminViewsNoUrlTest(TestCase):
@skipUnlessDBFeature('can_defer_constraint_checks')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewDeletedObjectsTest(TestCase):
fixtures = ['admin-views-users.xml', 'deleted-objects.xml']
@@ -1909,7 +1909,7 @@ class AdminViewDeletedObjectsTest(TestCase):
self.assertContains(response, should_contain)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class TestGenericRelations(TestCase):
fixtures = ['admin-views-users.xml', 'deleted-objects.xml']
@@ -1924,7 +1924,7 @@ class TestGenericRelations(TestCase):
self.assertContains(response, "%s</td>" % plot)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewStringPrimaryKeyTest(TestCase):
fixtures = ['admin-views-users.xml', 'string-primary-key.xml']
@@ -2079,7 +2079,7 @@ class AdminViewStringPrimaryKeyTest(TestCase):
)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class SecureViewTests(TestCase):
"""
@@ -2099,7 +2099,7 @@ class SecureViewTests(TestCase):
self.assertEqual(response.context[REDIRECT_FIELD_NAME], secure_url)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewUnicodeTest(TestCase):
fixtures = ['admin-views-unicode.xml']
@@ -2151,7 +2151,7 @@ class AdminViewUnicodeTest(TestCase):
self.assertRedirects(response, '/test_admin/admin/admin_views/book/')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewListEditable(TestCase):
fixtures = ['admin-views-users.xml', 'admin-views-person.xml']
@@ -2525,7 +2525,7 @@ class AdminViewListEditable(TestCase):
self.assertContains(response, '<th class="field-id"><a href="%s">%d</a></th>' % (link2, story2.id), 1)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminSearchTest(TestCase):
fixtures = ['admin-views-users', 'multiple-child-classes',
@@ -2609,7 +2609,7 @@ class AdminSearchTest(TestCase):
html=True)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminInheritedInlinesTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -2694,7 +2694,7 @@ class AdminInheritedInlinesTest(TestCase):
self.assertEqual(Persona.objects.all()[0].accounts.count(), 2)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminActionsTest(TestCase):
fixtures = ['admin-views-users.xml', 'admin-views-actions.xml']
@@ -2963,7 +2963,7 @@ action)</option>
self.assertEqual(response.template_name, 'admin/popup_response.html')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class TestCustomChangeList(TestCase):
fixtures = ['admin-views-users.xml']
@@ -2989,7 +2989,7 @@ class TestCustomChangeList(TestCase):
self.assertNotContains(response, 'First Gadget')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class TestInlineNotEditable(TestCase):
fixtures = ['admin-views-users.xml']
@@ -3006,7 +3006,7 @@ class TestInlineNotEditable(TestCase):
self.assertEqual(response.status_code, 200)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminCustomQuerysetTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -3251,7 +3251,7 @@ class AdminCustomQuerysetTest(TestCase):
self.assertEqual(self.client.get('/test_admin/admin/admin_views/filteredmanager/2/history/').status_code, 200)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminInlineFileUploadTest(TestCase):
fixtures = ['admin-views-users.xml', 'admin-views-actions.xml']
@@ -3295,7 +3295,7 @@ class AdminInlineFileUploadTest(TestCase):
self.assertContains(response, b"Currently")
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminInlineTests(TestCase):
fixtures = ['admin-views-users.xml']
@@ -3611,7 +3611,7 @@ class AdminInlineTests(TestCase):
self.assertEqual(Category.objects.get(id=4).order, 0)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class NeverCacheTests(TestCase):
fixtures = ['admin-views-users.xml', 'admin-views-colors.xml', 'admin-views-fabrics.xml']
@@ -3682,7 +3682,7 @@ class NeverCacheTests(TestCase):
self.assertEqual(get_max_age(response), None)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class PrePopulatedTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -3715,7 +3715,7 @@ class PrePopulatedTest(TestCase):
self.assertContains(response, "maxLength: 1000") # instead of 1,000
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
@@ -3944,7 +3944,7 @@ class SeleniumAdminViewsIETests(SeleniumAdminViewsFirefoxTests):
webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class ReadonlyTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -4052,7 +4052,7 @@ class ReadonlyTest(TestCase):
self.assertNotContains(response, "Some help text for the date (with unicode ŠĐĆŽćžšđ)")
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class LimitChoicesToInAdminTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -4076,7 +4076,7 @@ class LimitChoicesToInAdminTest(TestCase):
self.assertNotContains(response, marley.username)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class RawIdFieldsTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -4153,7 +4153,7 @@ class RawIdFieldsTest(TestCase):
self.assertContains(response2, "Palin")
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class UserAdminTest(TestCase):
"""
@@ -4297,7 +4297,7 @@ class UserAdminTest(TestCase):
self.assertEqual(response.context['form_url'], 'pony')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class GroupAdminTest(TestCase):
"""
@@ -4329,7 +4329,7 @@ class GroupAdminTest(TestCase):
self.assertEqual(response.status_code, 200)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class CSSTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -4451,7 +4451,7 @@ except ImportError:
@unittest.skipUnless(docutils, "no docutils installed.")
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
@modify_settings(INSTALLED_APPS={'append': ['django.contrib.admindocs', 'django.contrib.flatpages']})
class AdminDocsTest(TestCase):
@@ -4493,7 +4493,7 @@ class AdminDocsTest(TestCase):
@override_settings(
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls",
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
@@ -4522,7 +4522,7 @@ class ValidXHTMLTests(TestCase):
self.assertNotContains(response, ' xml:lang=""')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls",
USE_THOUSAND_SEPARATOR=True, USE_L10N=True)
class DateHierarchyTests(TestCase):
@@ -4645,7 +4645,7 @@ class DateHierarchyTests(TestCase):
self.assert_non_localized_year(response, 2005)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminCustomSaveRelatedTests(TestCase):
"""
@@ -4714,7 +4714,7 @@ class AdminCustomSaveRelatedTests(TestCase):
self.assertEqual(['Catherine Stone', 'Paul Stone'], children_names)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewLogoutTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -4740,7 +4740,7 @@ class AdminViewLogoutTest(TestCase):
self.assertContains(response, '<input type="hidden" name="next" value="/test_admin/admin/" />')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminUserMessageTest(TestCase):
fixtures = ['admin-views-users.xml']
@@ -4795,7 +4795,7 @@ class AdminUserMessageTest(TestCase):
html=True)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminKeepChangeListFiltersTests(TestCase):
fixtures = ['admin-views-users.xml']
@@ -5078,7 +5078,7 @@ class NamespacedAdminKeepChangeListFiltersTests(AdminKeepChangeListFiltersTests)
admin_site = site2
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class TestLabelVisibility(TestCase):
""" #11277 -Labels of hidden fields in admin were not hidden. """
@@ -5119,7 +5119,7 @@ class TestLabelVisibility(TestCase):
self.assertContains(response, '<div class="form-row hidden')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class AdminViewOnSiteTests(TestCase):
fixtures = ['admin-views-users.xml', 'admin-views-restaurants.xml']
@@ -5237,7 +5237,7 @@ class AdminViewOnSiteTests(TestCase):
self.assertIsNone(model_admin.get_view_on_site_url(Worker()))
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls")
class InlineAdminViewOnSiteTest(TestCase):
fixtures = ['admin-views-users.xml', 'admin-views-restaurants.xml']
@@ -5287,7 +5287,7 @@ class TestEtagWithAdminView(TestCase):
@override_settings(
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="admin_views.urls",
)
class GetFormsetsWithInlinesArgumentTest(TestCase):
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index c5795c87fb..c2855bb237 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -167,7 +167,7 @@ class AdminFormfieldForDBFieldTests(TestCase):
self.assertEqual(six.text_type(f.help_text), 'Hold down "Control", or "Command" on a Mac, to select more than one.')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class AdminFormfieldForDBFieldWithRequestTests(DjangoTestCase):
fixtures = ["admin-widgets-users.xml"]
@@ -182,7 +182,7 @@ class AdminFormfieldForDBFieldWithRequestTests(DjangoTestCase):
self.assertContains(response, "Volkswagon Passat")
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class AdminForeignKeyWidgetChangeList(DjangoTestCase):
fixtures = ["admin-widgets-users.xml"]
@@ -195,7 +195,7 @@ class AdminForeignKeyWidgetChangeList(DjangoTestCase):
self.assertContains(response, '/auth/user/add/')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class AdminForeignKeyRawIdWidget(DjangoTestCase):
fixtures = ["admin-widgets-users.xml"]
@@ -537,7 +537,7 @@ class RelatedFieldWidgetWrapperTests(DjangoTestCase):
self.assertFalse(wrapper.can_delete_related)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class DateTimePickerSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
@@ -715,7 +715,7 @@ class DateTimePickerSeleniumIETests(DateTimePickerSeleniumFirefoxTests):
@skipIf(pytz is None, "this test requires pytz")
@override_settings(TIME_ZONE='Asia/Singapore')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class DateTimePickerShortcutsSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
available_apps = ['admin_widgets'] + AdminSeleniumWebDriverTestCase.available_apps
@@ -783,7 +783,7 @@ class DateTimePickerShortcutsSeleniumIETests(DateTimePickerShortcutsSeleniumFire
webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class HorizontalVerticalFilterSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
@@ -1038,7 +1038,7 @@ class HorizontalVerticalFilterSeleniumIETests(HorizontalVerticalFilterSeleniumFi
webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class AdminRawIdWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
available_apps = ['admin_widgets'] + AdminSeleniumWebDriverTestCase.available_apps
@@ -1129,7 +1129,7 @@ class AdminRawIdWidgetSeleniumIETests(AdminRawIdWidgetSeleniumFirefoxTests):
webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver'
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='admin_widgets.urls')
class RelatedFieldWidgetSeleniumFirefoxTests(AdminSeleniumWebDriverTestCase):
available_apps = ['admin_widgets'] + AdminSeleniumWebDriverTestCase.available_apps
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index db2edf5f26..c17ef12ae0 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -1508,10 +1508,10 @@ class CacheHEADTest(TestCase):
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
},
- LANGUAGES=(
+ LANGUAGES=[
('en', 'English'),
('es', 'Spanish'),
- ),
+ ],
)
class CacheI18nTest(TestCase):
diff --git a/tests/check_framework/tests.py b/tests/check_framework/tests.py
index ea4a8766bf..d15988b117 100644
--- a/tests/check_framework/tests.py
+++ b/tests/check_framework/tests.py
@@ -113,7 +113,7 @@ class MessageTests(TestCase):
class Django_1_7_0_CompatibilityChecks(TestCase):
- @override_settings(MIDDLEWARE_CLASSES=('django.contrib.sessions.middleware.SessionMiddleware',))
+ @override_settings(MIDDLEWARE_CLASSES=['django.contrib.sessions.middleware.SessionMiddleware'])
def test_middleware_classes_overridden(self):
errors = check_1_7_compatibility()
self.assertEqual(errors, [])
diff --git a/tests/context_processors/tests.py b/tests/context_processors/tests.py
index d7c7390189..f6c6600402 100644
--- a/tests/context_processors/tests.py
+++ b/tests/context_processors/tests.py
@@ -48,7 +48,7 @@ class RequestContextProcessorTests(TestCase):
@override_settings(
DEBUG=True,
- INTERNAL_IPS=('127.0.0.1',),
+ INTERNAL_IPS=['127.0.0.1'],
ROOT_URLCONF='context_processors.urls',
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py
index 610cf13630..7036c199d0 100644
--- a/tests/file_uploads/tests.py
+++ b/tests/file_uploads/tests.py
@@ -28,7 +28,7 @@ MEDIA_ROOT = sys_tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR'])
UPLOAD_TO = os.path.join(MEDIA_ROOT, 'test_upload')
-@override_settings(MEDIA_ROOT=MEDIA_ROOT, ROOT_URLCONF='file_uploads.urls', MIDDLEWARE_CLASSES=())
+@override_settings(MEDIA_ROOT=MEDIA_ROOT, ROOT_URLCONF='file_uploads.urls', MIDDLEWARE_CLASSES=[])
class FileUploadTests(TestCase):
@classmethod
diff --git a/tests/forms_tests/tests/test_input_formats.py b/tests/forms_tests/tests/test_input_formats.py
index f939821c75..60e153db4c 100644
--- a/tests/forms_tests/tests/test_input_formats.py
+++ b/tests/forms_tests/tests/test_input_formats.py
@@ -10,7 +10,7 @@ from django.test import SimpleTestCase
class LocalizedTimeTests(SimpleTestCase):
def setUp(self):
# nl/formats.py has customized TIME_INPUT_FORMATS:
- # ('%H:%M:%S', '%H.%M:%S', '%H.%M', '%H:%M')
+ # ['%H:%M:%S', '%H.%M:%S', '%H.%M', '%H:%M']
activate('nl')
def tearDown(self):
diff --git a/tests/generic_inline_admin/tests.py b/tests/generic_inline_admin/tests.py
index 1458f6f73f..325d94c7a7 100644
--- a/tests/generic_inline_admin/tests.py
+++ b/tests/generic_inline_admin/tests.py
@@ -17,7 +17,7 @@ from .models import Episode, Media, EpisodePermanent, Category
# Set TEMPLATE_DEBUG to True to ensure {% include %} will raise exceptions.
# That is how inlines are rendered and #9498 will bubble up if it is an issue.
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
TEMPLATE_DEBUG=True,
ROOT_URLCONF="generic_inline_admin.urls")
class GenericAdminViewTest(TestCase):
@@ -123,7 +123,7 @@ class GenericAdminViewTest(TestCase):
self.assertTrue(formset.get_queryset().ordered)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="generic_inline_admin.urls")
class GenericInlineAdminParametersTest(TestCase):
fixtures = ['users.xml']
@@ -270,7 +270,7 @@ class GenericInlineAdminParametersTest(TestCase):
self.assertEqual(formset.max_num, 2)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF="generic_inline_admin.urls")
class GenericInlineAdminWithUniqueTogetherTest(TestCase):
fixtures = ['users.xml']
diff --git a/tests/i18n/contenttypes/tests.py b/tests/i18n/contenttypes/tests.py
index 23b1ac6c73..a93f2030f2 100644
--- a/tests/i18n/contenttypes/tests.py
+++ b/tests/i18n/contenttypes/tests.py
@@ -12,14 +12,14 @@ from django.utils import translation
@override_settings(
USE_I18N=True,
- LOCALE_PATHS=(
+ LOCALE_PATHS=[
os.path.join(os.path.dirname(upath(__file__)), 'locale'),
- ),
+ ],
LANGUAGE_CODE='en',
- LANGUAGES=(
+ LANGUAGES=[
('en', 'English'),
('fr', 'French'),
- ),
+ ],
)
class ContentTypeTests(TestCase):
def test_verbose_name(self):
diff --git a/tests/i18n/patterns/tests.py b/tests/i18n/patterns/tests.py
index 2bf770434b..f96ac82fc4 100644
--- a/tests/i18n/patterns/tests.py
+++ b/tests/i18n/patterns/tests.py
@@ -18,19 +18,19 @@ class PermanentRedirectLocaleMiddleWare(LocaleMiddleware):
@override_settings(
USE_I18N=True,
- LOCALE_PATHS=(
+ LOCALE_PATHS=[
os.path.join(os.path.dirname(upath(__file__)), 'locale'),
- ),
+ ],
LANGUAGE_CODE='en-us',
- LANGUAGES=(
+ LANGUAGES=[
('nl', 'Dutch'),
('en', 'English'),
('pt-br', 'Brazilian Portuguese'),
- ),
- MIDDLEWARE_CLASSES=(
+ ],
+ MIDDLEWARE_CLASSES=[
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
- ),
+ ],
ROOT_URLCONF='i18n.patterns.urls.default',
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
@@ -193,10 +193,10 @@ class URLRedirectTests(URLTestCaseBase):
self.assertEqual(response.status_code, 200)
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'i18n.patterns.tests.PermanentRedirectLocaleMiddleWare',
'django.middleware.common.CommonMiddleware',
- ),
+ ],
)
def test_custom_redirect_class(self):
response = self.client.get('/account/register/', HTTP_ACCEPT_LANGUAGE='en')
diff --git a/tests/i18n/test_compilation.py b/tests/i18n/test_compilation.py
index bc76a5337c..c17db0a98a 100644
--- a/tests/i18n/test_compilation.py
+++ b/tests/i18n/test_compilation.py
@@ -92,7 +92,7 @@ class PercentRenderingTests(MessageCompilationTests):
self.addCleanup(os.unlink, os.path.join(self.test_dir, self.MO_FILE))
def test_percent_symbol_escaping(self):
- with override_settings(LOCALE_PATHS=(os.path.join(self.test_dir, 'locale'),)):
+ with override_settings(LOCALE_PATHS=[os.path.join(self.test_dir, 'locale')]):
from django.template import Template, Context
call_command('compilemessages', locale=[self.LOCALE], stdout=StringIO())
with translation.override(self.LOCALE):
@@ -119,13 +119,13 @@ class MultipleLocaleCompilationTests(MessageCompilationTests):
self.addCleanup(self.rmfile, os.path.join(localedir, self.MO_FILE_FR))
def test_one_locale(self):
- with override_settings(LOCALE_PATHS=(os.path.join(self.test_dir, 'locale'),)):
+ with override_settings(LOCALE_PATHS=[os.path.join(self.test_dir, 'locale')]):
call_command('compilemessages', locale=['hr'], stdout=StringIO())
self.assertTrue(os.path.exists(self.MO_FILE_HR))
def test_multiple_locales(self):
- with override_settings(LOCALE_PATHS=(os.path.join(self.test_dir, 'locale'),)):
+ with override_settings(LOCALE_PATHS=[os.path.join(self.test_dir, 'locale')]):
call_command('compilemessages', locale=['hr', 'fr'], stdout=StringIO())
self.assertTrue(os.path.exists(self.MO_FILE_HR))
@@ -202,14 +202,14 @@ class FuzzyTranslationTest(MessageCompilationTests):
gettext_module._translations = {} # flush cache or test will be useless
def test_nofuzzy_compiling(self):
- with override_settings(LOCALE_PATHS=(os.path.join(self.test_dir, 'locale'),)):
+ with override_settings(LOCALE_PATHS=[os.path.join(self.test_dir, 'locale')]):
call_command('compilemessages', locale=[self.LOCALE], stdout=StringIO())
with translation.override(self.LOCALE):
self.assertEqual(ugettext('Lenin'), force_text('Ленин'))
self.assertEqual(ugettext('Vodka'), force_text('Vodka'))
def test_fuzzy_compiling(self):
- with override_settings(LOCALE_PATHS=(os.path.join(self.test_dir, 'locale'),)):
+ with override_settings(LOCALE_PATHS=[os.path.join(self.test_dir, 'locale')]):
call_command('compilemessages', locale=[self.LOCALE], fuzzy=True, stdout=StringIO())
with translation.override(self.LOCALE):
self.assertEqual(ugettext('Lenin'), force_text('Ленин'))
diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py
index 94948b203e..99d4983b43 100644
--- a/tests/i18n/test_extraction.py
+++ b/tests/i18n/test_extraction.py
@@ -721,8 +721,7 @@ class CustomLayoutExtractionTests(ExtractorTests):
management.call_command('makemessages', locale=LOCALE, verbosity=0)
@override_settings(
- LOCALE_PATHS=(os.path.join(
- this_directory, 'project_dir', 'project_locale'),)
+ LOCALE_PATHS=[os.path.join(this_directory, 'project_dir', 'project_locale')],
)
def test_project_locale_paths(self):
"""
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index 0b5714d6bf..cbc31828b4 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -42,9 +42,9 @@ from .models import Company, TestModel
here = os.path.dirname(os.path.abspath(upath(__file__)))
-extended_locale_paths = settings.LOCALE_PATHS + (
+extended_locale_paths = settings.LOCALE_PATHS + [
os.path.join(here, 'other', 'locale'),
-)
+]
@contextmanager
@@ -397,7 +397,7 @@ class TranslationTests(TestCase):
self.assertEqual(trans_real.to_language('en_US'), 'en-us')
self.assertEqual(trans_real.to_language('sr_Lat'), 'sr-lat')
- @override_settings(LOCALE_PATHS=(os.path.join(here, 'other', 'locale'),))
+ @override_settings(LOCALE_PATHS=[os.path.join(here, 'other', 'locale')])
def test_bad_placeholder_1(self):
"""
Error in translation file should not crash template rendering
@@ -409,7 +409,7 @@ class TranslationTests(TestCase):
rendered = t.render(Context({'person': 'James'}))
self.assertEqual(rendered, 'My name is James.')
- @override_settings(LOCALE_PATHS=(os.path.join(here, 'other', 'locale'),))
+ @override_settings(LOCALE_PATHS=[os.path.join(here, 'other', 'locale')])
def test_bad_placeholder_2(self):
"""
Error in translation file should not crash template rendering
@@ -998,11 +998,11 @@ class MiscTests(TestCase):
self.assertEqual('zh-hant', g(r))
@override_settings(
- LANGUAGES=(
+ LANGUAGES=[
('en', 'English'),
('zh-hans', 'Simplified Chinese'),
('zh-hant', 'Traditional Chinese'),
- )
+ ]
)
def test_support_for_deprecated_chinese_language_codes(self):
"""
@@ -1112,7 +1112,7 @@ class MiscTests(TestCase):
r.COOKIES = {}
r.META = {'HTTP_ACCEPT_LANGUAGE': 'pt-br'}
self.assertEqual('pt-br', g(r))
- with self.settings(LANGUAGES=(('en', 'English'),)):
+ with self.settings(LANGUAGES=[('en', 'English')]):
self.assertNotEqual('pt-br', g(r))
@@ -1342,14 +1342,14 @@ class MultipleLocaleActivationTests(TestCase):
@override_settings(
USE_I18N=True,
- LANGUAGES=(
+ LANGUAGES=[
('en', 'English'),
('fr', 'French'),
- ),
- MIDDLEWARE_CLASSES=(
+ ],
+ MIDDLEWARE_CLASSES=[
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
- ),
+ ],
ROOT_URLCONF='i18n.urls',
)
class LocaleMiddlewareTests(TestCase):
@@ -1362,11 +1362,11 @@ class LocaleMiddlewareTests(TestCase):
self.assertContains(response, "Yes/No")
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
- ),
+ ],
)
def test_language_not_saved_to_session(self):
"""Checks that current language is not automatically saved to
@@ -1378,15 +1378,15 @@ class LocaleMiddlewareTests(TestCase):
@override_settings(
USE_I18N=True,
- LANGUAGES=(
+ LANGUAGES=[
('bg', 'Bulgarian'),
('en-us', 'English'),
('pt-br', 'Portugese (Brazil)'),
- ),
- MIDDLEWARE_CLASSES=(
+ ],
+ MIDDLEWARE_CLASSES=[
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
- ),
+ ],
ROOT_URLCONF='i18n.urls'
)
class CountrySpecificLanguageTests(TestCase):
diff --git a/tests/logging_tests/tests.py b/tests/logging_tests/tests.py
index 65b2be4135..3e4c19ece5 100644
--- a/tests/logging_tests/tests.py
+++ b/tests/logging_tests/tests.py
@@ -185,7 +185,7 @@ class AdminEmailHandlerTest(TestCase):
self.assertTrue(admin_email_handler.connection().fail_silently)
@override_settings(
- ADMINS=(('whatever admin', 'admin@example.com'),),
+ ADMINS=[('whatever admin', 'admin@example.com')],
EMAIL_SUBJECT_PREFIX='-SuperAwesomeSubject-'
)
def test_accepts_args(self):
@@ -215,9 +215,9 @@ class AdminEmailHandlerTest(TestCase):
admin_email_handler.filters = orig_filters
@override_settings(
- ADMINS=(('whatever admin', 'admin@example.com'),),
+ ADMINS=[('whatever admin', 'admin@example.com')],
EMAIL_SUBJECT_PREFIX='-SuperAwesomeSubject-',
- INTERNAL_IPS=('127.0.0.1',),
+ INTERNAL_IPS=['127.0.0.1'],
)
def test_accepts_args_and_request(self):
"""
@@ -250,7 +250,7 @@ class AdminEmailHandlerTest(TestCase):
admin_email_handler.filters = orig_filters
@override_settings(
- ADMINS=(('admin', 'admin@example.com'),),
+ ADMINS=[('admin', 'admin@example.com')],
EMAIL_SUBJECT_PREFIX='',
DEBUG=False,
)
@@ -295,7 +295,7 @@ class AdminEmailHandlerTest(TestCase):
self.assertEqual(mail.outbox[0].subject, expected_subject)
@override_settings(
- ADMINS=(('admin', 'admin@example.com'),),
+ ADMINS=[('admin', 'admin@example.com')],
DEBUG=False,
)
def test_uses_custom_email_backend(self):
@@ -327,7 +327,7 @@ class AdminEmailHandlerTest(TestCase):
admin_email_handler.email_backend = orig_email_backend
@override_settings(
- ADMINS=(('whatever admin', 'admin@example.com'),),
+ ADMINS=[('whatever admin', 'admin@example.com')],
)
def test_emit_non_ascii(self):
"""
@@ -347,7 +347,7 @@ class AdminEmailHandlerTest(TestCase):
self.assertIn("path:%s" % url_path, msg.body)
@override_settings(
- MANAGERS=(('manager', 'manager@example.com'),),
+ MANAGERS=[('manager', 'manager@example.com')],
DEBUG=False,
)
def test_customize_send_mail_method(self):
@@ -423,7 +423,7 @@ class SecurityLoggerTest(TestCase):
self.assertEqual(calls[0], 'dubious')
@override_settings(
- ADMINS=(('admin', 'admin@example.com'),),
+ ADMINS=[('admin', 'admin@example.com')],
DEBUG=False,
)
def test_suspicious_email_admins(self):
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index 5b5c9e1c70..683f47fe31 100644
--- a/tests/mail/tests.py
+++ b/tests/mail/tests.py
@@ -606,7 +606,7 @@ class BaseEmailBackendTests(HeadersCheckMixin, object):
message = self.get_the_message()
self.assertEqual(message.get('subject'), '[Django] Subject')
- @override_settings(ADMINS=(), MANAGERS=())
+ @override_settings(ADMINS=[], MANAGERS=[])
def test_empty_admins(self):
"""
Test that mail_admins/mail_managers doesn't connect to the mail server
diff --git a/tests/middleware/tests.py b/tests/middleware/tests.py
index 770d500444..c7620732b5 100644
--- a/tests/middleware/tests.py
+++ b/tests/middleware/tests.py
@@ -277,8 +277,8 @@ class CommonMiddlewareTest(TestCase):
@override_settings(
- IGNORABLE_404_URLS=(re.compile(r'foo'),),
- MANAGERS=('PHB@dilbert.com',),
+ IGNORABLE_404_URLS=[re.compile(r'foo')],
+ MANAGERS=['PHB@dilbert.com'],
)
class BrokenLinkEmailsMiddlewareTest(TestCase):
diff --git a/tests/middleware_exceptions/tests.py b/tests/middleware_exceptions/tests.py
index 8c191e4ea5..9c7a24ec22 100644
--- a/tests/middleware_exceptions/tests.py
+++ b/tests/middleware_exceptions/tests.py
@@ -868,9 +868,9 @@ class MiddlewareNotUsedTests(TestCase):
with self.assertRaises(MiddlewareNotUsed):
MyMiddleware().process_request(request)
- @override_settings(MIDDLEWARE_CLASSES=(
+ @override_settings(MIDDLEWARE_CLASSES=[
'middleware_exceptions.tests.MyMiddleware',
- ))
+ ])
def test_log(self):
with patch_logger('django.request', 'debug') as calls:
self.client.get('/middleware_exceptions/view/')
@@ -880,9 +880,9 @@ class MiddlewareNotUsedTests(TestCase):
"MiddlewareNotUsed: 'middleware_exceptions.tests.MyMiddleware'"
)
- @override_settings(MIDDLEWARE_CLASSES=(
+ @override_settings(MIDDLEWARE_CLASSES=[
'middleware_exceptions.tests.MyMiddlewareWithExceptionMessage',
- ))
+ ])
def test_log_custom_message(self):
with patch_logger('django.request', 'debug') as calls:
self.client.get('/middleware_exceptions/view/')
diff --git a/tests/model_regress/test_pickle.py b/tests/model_regress/test_pickle.py
index 5348b4a495..64d2f6df5f 100644
--- a/tests/model_regress/test_pickle.py
+++ b/tests/model_regress/test_pickle.py
@@ -71,7 +71,7 @@ from django.conf import settings
data = %r
-settings.configure(DEBUG=False, INSTALLED_APPS=('model_regress',), SECRET_KEY = "blah")
+settings.configure(DEBUG=False, INSTALLED_APPS=['model_regress'], SECRET_KEY = "blah")
article = pickle.loads(data)
print(article.headline)"""
a = Article.objects.create(
diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py
index cb4ea3c9eb..131bd1524f 100644
--- a/tests/proxy_models/tests.py
+++ b/tests/proxy_models/tests.py
@@ -380,7 +380,7 @@ class ProxyModelTests(TestCase):
self.assertEqual(MyPerson(id=100), Person(id=100))
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='proxy_models.urls',)
class ProxyModelAdminTests(TestCase):
fixtures = ['myhorses']
diff --git a/tests/runtests.py b/tests/runtests.py
index 6cb589b935..e232da9c63 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -50,13 +50,13 @@ ALWAYS_INSTALLED_APPS = [
'django.contrib.staticfiles',
]
-ALWAYS_MIDDLEWARE_CLASSES = (
+ALWAYS_MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
-)
+]
def get_test_modules():
@@ -116,7 +116,7 @@ def setup(verbosity, test_labels):
settings.STATIC_URL = '/static/'
settings.STATIC_ROOT = os.path.join(TEMP_DIR, 'static')
# Remove the following line in Django 2.0.
- settings.TEMPLATE_DIRS = (TEMPLATE_DIR,)
+ settings.TEMPLATE_DIRS = [TEMPLATE_DIR]
settings.TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR],
diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py
index 0befd18e29..8d39d6c1b1 100644
--- a/tests/settings_tests/tests.py
+++ b/tests/settings_tests/tests.py
@@ -441,12 +441,12 @@ class IsOverriddenTest(TestCase):
self.assertTrue(settings.is_overridden('ALLOWED_HOSTS'))
-class TestTupleSettings(unittest.TestCase):
+class TestListSettings(unittest.TestCase):
"""
- Make sure settings that should be tuples throw ImproperlyConfigured if they
- are set to a string instead of a tuple.
+ Make sure settings that should be lists or tuples throw
+ ImproperlyConfigured if they are set to a string instead of a list or tuple.
"""
- tuple_settings = (
+ list_or_tuple_settings = (
"ALLOWED_INCLUDE_ROOTS",
"INSTALLED_APPS",
"TEMPLATE_DIRS",
@@ -456,8 +456,8 @@ class TestTupleSettings(unittest.TestCase):
def test_tuple_settings(self):
settings_module = ModuleType('fake_settings_module')
settings_module.SECRET_KEY = 'foo'
- for setting in self.tuple_settings:
- setattr(settings_module, setting, ('non_tuple_value'))
+ for setting in self.list_or_tuple_settings:
+ setattr(settings_module, setting, ('non_list_or_tuple_value'))
sys.modules['fake_settings_module'] = settings_module
try:
with self.assertRaises(ImproperlyConfigured):
diff --git a/tests/staticfiles_tests/tests.py b/tests/staticfiles_tests/tests.py
index 1d5ccfc075..43cee9e636 100644
--- a/tests/staticfiles_tests/tests.py
+++ b/tests/staticfiles_tests/tests.py
@@ -33,16 +33,16 @@ TEST_SETTINGS = {
'STATIC_URL': '/static/',
'MEDIA_ROOT': os.path.join(TEST_ROOT, 'project', 'site_media', 'media'),
'STATIC_ROOT': os.path.join(TEST_ROOT, 'project', 'site_media', 'static'),
- 'STATICFILES_DIRS': (
+ 'STATICFILES_DIRS': [
os.path.join(TEST_ROOT, 'project', 'documents'),
('prefix', os.path.join(TEST_ROOT, 'project', 'prefixed')),
- ),
- 'STATICFILES_FINDERS': (
+ ],
+ 'STATICFILES_FINDERS': [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.DefaultStorageFinder',
- ),
- 'INSTALLED_APPS': (
+ ],
+ 'INSTALLED_APPS': [
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.admin.apps.SimpleAdminConfig',
@@ -50,7 +50,7 @@ TEST_SETTINGS = {
'staticfiles_tests',
'staticfiles_tests.apps.test',
'staticfiles_tests.apps.no_label',
- ),
+ ],
}
from django.contrib.staticfiles.management.commands.collectstatic import Command as CollectstaticCommand
@@ -600,8 +600,8 @@ class TestHashedFiles(object):
self.assertIn(b"other.d41d8cd98f00.css", content)
@override_settings(
- STATICFILES_DIRS=(os.path.join(TEST_ROOT, 'project', 'faulty'),),
- STATICFILES_FINDERS=('django.contrib.staticfiles.finders.FileSystemFinder',),
+ STATICFILES_DIRS=[os.path.join(TEST_ROOT, 'project', 'faulty')],
+ STATICFILES_FINDERS=['django.contrib.staticfiles.finders.FileSystemFinder'],
)
def test_post_processing_failure(self):
"""
@@ -898,7 +898,7 @@ class TestDefaultStorageFinder(StaticFilesTestCase, FinderTestCase):
@override_settings(
- STATICFILES_FINDERS=('django.contrib.staticfiles.finders.FileSystemFinder',),
+ STATICFILES_FINDERS=['django.contrib.staticfiles.finders.FileSystemFinder'],
STATICFILES_DIRS=[os.path.join(TEST_ROOT, 'project', 'documents')],
)
class TestMiscFinder(TestCase):
diff --git a/tests/template_tests/test_response.py b/tests/template_tests/test_response.py
index 3807789e63..5c73265ded 100644
--- a/tests/template_tests/test_response.py
+++ b/tests/template_tests/test_response.py
@@ -333,7 +333,7 @@ class TemplateResponseTest(SimpleTestCase):
@override_settings(
- MIDDLEWARE_CLASSES=list(settings.MIDDLEWARE_CLASSES) + [
+ MIDDLEWARE_CLASSES=settings.MIDDLEWARE_CLASSES + [
'template_tests.test_response.CustomURLConfMiddleware'
],
ROOT_URLCONF='template_tests.urls',
@@ -348,7 +348,7 @@ class CustomURLConfTest(SimpleTestCase):
@override_settings(
CACHE_MIDDLEWARE_SECONDS=2.0,
- MIDDLEWARE_CLASSES=list(settings.MIDDLEWARE_CLASSES) + [
+ MIDDLEWARE_CLASSES=settings.MIDDLEWARE_CLASSES + [
'django.middleware.cache.FetchFromCacheMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
],
diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py
index cf96b89a62..7059c23a81 100644
--- a/tests/test_client/tests.py
+++ b/tests/test_client/tests.py
@@ -30,7 +30,7 @@ from django.test import override_settings
from .views import get_view, post_view, trace_view
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='test_client.urls',)
class ClientTest(TestCase):
fixtures = ['testdata.json']
@@ -530,7 +530,7 @@ class ClientTest(TestCase):
@override_settings(
- MIDDLEWARE_CLASSES=('django.middleware.csrf.CsrfViewMiddleware',),
+ MIDDLEWARE_CLASSES=['django.middleware.csrf.CsrfViewMiddleware'],
ROOT_URLCONF='test_client.urls',
)
class CSRFEnabledClientTests(TestCase):
diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py
index 2d97823854..c97ad550d1 100644
--- a/tests/test_client_regress/tests.py
+++ b/tests/test_client_regress/tests.py
@@ -188,7 +188,7 @@ class AssertContainsTests(TestCase):
self.assertNotContains(response, 'Bye')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='test_client_regress.urls',)
class AssertTemplateUsedTests(TestCase):
fixtures = ['testdata.json']
@@ -810,7 +810,7 @@ class AssertFormsetErrorTests(TestCase):
**kwargs)
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='test_client_regress.urls',)
class LoginTests(TestCase):
fixtures = ['testdata']
@@ -833,7 +833,7 @@ class LoginTests(TestCase):
@override_settings(
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
SESSION_ENGINE='test_client_regress.session',
ROOT_URLCONF='test_client_regress.urls',
)
@@ -879,7 +879,7 @@ class URLEscapingTests(TestCase):
self.assertEqual(response.content, b'Hi, Arthur')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='test_client_regress.urls',)
class ExceptionTests(TestCase):
fixtures = ['testdata.json']
@@ -948,7 +948,7 @@ class zzUrlconfSubstitutionTests(TestCase):
reverse('arg_view', args=['somename'])
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='test_client_regress.urls',)
class ContextTests(TestCase):
fixtures = ['testdata']
@@ -1023,7 +1023,7 @@ class ContextTests(TestCase):
self.assertEqual(response.context['nested'], 'yes')
-@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='test_client_regress.urls',)
class SessionTests(TestCase):
fixtures = ['testdata.json']
diff --git a/tests/test_sqlite.py b/tests/test_sqlite.py
index 6bce452c79..18d413a682 100644
--- a/tests/test_sqlite.py
+++ b/tests/test_sqlite.py
@@ -24,6 +24,6 @@ DATABASES = {
SECRET_KEY = "django_tests_secret_key"
# Use a fast hasher to speed up tests.
-PASSWORD_HASHERS = (
+PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
-)
+]
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py
index 677d51ac2e..a8ee433464 100644
--- a/tests/timezones/tests.py
+++ b/tests/timezones/tests.py
@@ -1074,7 +1074,7 @@ class NewFormsTests(TestCase):
@override_settings(DATETIME_FORMAT='c', TIME_ZONE='Africa/Nairobi', USE_L10N=False, USE_TZ=True,
- PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
+ PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLCONF='timezones.urls')
class AdminTests(TestCase):
diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py
index 50a0881a41..7b46d0a0a3 100644
--- a/tests/urlpatterns_reverse/tests.py
+++ b/tests/urlpatterns_reverse/tests.py
@@ -538,9 +538,9 @@ class RequestURLconfTests(TestCase):
self.assertEqual(response.status_code, 404)
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'%s.ChangeURLconfMiddleware' % middleware.__name__,
- )
+ ]
)
def test_urlconf_overridden(self):
response = self.client.get('/test/me/')
@@ -552,18 +552,18 @@ class RequestURLconfTests(TestCase):
self.assertEqual(response.content, b'outer:,inner:/second_test/')
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'%s.NullChangeURLconfMiddleware' % middleware.__name__,
- )
+ ]
)
def test_urlconf_overridden_with_null(self):
self.assertRaises(ImproperlyConfigured, self.client.get, '/test/me/')
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'%s.ChangeURLconfMiddleware' % middleware.__name__,
'%s.ReverseInnerInResponseMiddleware' % middleware.__name__,
- )
+ ]
)
def test_reverse_inner_in_response_middleware(self):
"""
@@ -575,10 +575,10 @@ class RequestURLconfTests(TestCase):
self.assertEqual(response.content, b'/second_test/')
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'%s.ChangeURLconfMiddleware' % middleware.__name__,
'%s.ReverseOuterInResponseMiddleware' % middleware.__name__,
- )
+ ]
)
def test_reverse_outer_in_response_middleware(self):
"""
@@ -590,10 +590,10 @@ class RequestURLconfTests(TestCase):
self.client.get('/second_test/')
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'%s.ChangeURLconfMiddleware' % middleware.__name__,
'%s.ReverseInnerInStreaming' % middleware.__name__,
- )
+ ]
)
def test_reverse_inner_in_streaming(self):
"""
@@ -605,10 +605,10 @@ class RequestURLconfTests(TestCase):
self.assertEqual(b''.join(response), b'/second_test/')
@override_settings(
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'%s.ChangeURLconfMiddleware' % middleware.__name__,
'%s.ReverseOuterInStreaming' % middleware.__name__,
- )
+ ]
)
def test_reverse_outer_in_streaming(self):
"""
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py
index bcb7d1a448..c0865cba57 100644
--- a/tests/utils_tests/test_autoreload.py
+++ b/tests/utils_tests/test_autoreload.py
@@ -27,7 +27,7 @@ class TestFilenameGenerator(TestCase):
'nl', 'LC_MESSAGES', 'django.mo'),
filenames)
- @override_settings(LOCALE_PATHS=(LOCALE_PATH,))
+ @override_settings(LOCALE_PATHS=[LOCALE_PATH])
def test_locale_paths_setting(self):
"""
Test that gen_filenames also yields from LOCALE_PATHS locales.
diff --git a/tests/view_tests/tests/test_csrf.py b/tests/view_tests/tests/test_csrf.py
index 893a7e200b..26ec221e01 100644
--- a/tests/view_tests/tests/test_csrf.py
+++ b/tests/view_tests/tests/test_csrf.py
@@ -11,11 +11,11 @@ class CsrfViewTests(TestCase):
@override_settings(
USE_I18N=True,
- MIDDLEWARE_CLASSES=(
+ MIDDLEWARE_CLASSES=[
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
- ),
+ ],
)
def test_translation(self):
"""
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py
index be6ceff1b5..8645bd3e8e 100644
--- a/tests/view_tests/tests/test_debug.py
+++ b/tests/view_tests/tests/test_debug.py
@@ -546,7 +546,7 @@ class ExceptionReportTestMixin(object):
"""
Asserts that potentially sensitive info are displayed in the email report.
"""
- with self.settings(ADMINS=(('Admin', 'admin@fattie-breakie.com'),)):
+ with self.settings(ADMINS=[('Admin', 'admin@fattie-breakie.com')]):
mail.outbox = [] # Empty outbox
request = self.rf.post('/some_url/', self.breakfast_data)
view(request)
@@ -579,7 +579,7 @@ class ExceptionReportTestMixin(object):
"""
Asserts that certain sensitive info are not displayed in the email report.
"""
- with self.settings(ADMINS=(('Admin', 'admin@fattie-breakie.com'),)):
+ with self.settings(ADMINS=[('Admin', 'admin@fattie-breakie.com')]):
mail.outbox = [] # Empty outbox
request = self.rf.post('/some_url/', self.breakfast_data)
view(request)
@@ -619,7 +619,7 @@ class ExceptionReportTestMixin(object):
"""
Asserts that no variables or POST parameters are displayed in the email report.
"""
- with self.settings(ADMINS=(('Admin', 'admin@fattie-breakie.com'),)):
+ with self.settings(ADMINS=[('Admin', 'admin@fattie-breakie.com')]):
mail.outbox = [] # Empty outbox
request = self.rf.post('/some_url/', self.breakfast_data)
view(request)
diff --git a/tests/view_tests/tests/test_i18n.py b/tests/view_tests/tests/test_i18n.py
index 5185a5c458..ba51d3289b 100644
--- a/tests/view_tests/tests/test_i18n.py
+++ b/tests/view_tests/tests/test_i18n.py
@@ -51,7 +51,7 @@ class I18NTests(TestCase):
# we force saving language to a cookie rather than a session
# by excluding session middleware and those which do require it
test_settings = dict(
- MIDDLEWARE_CLASSES=('django.middleware.common.CommonMiddleware',),
+ MIDDLEWARE_CLASSES=['django.middleware.common.CommonMiddleware'],
LANGUAGE_COOKIE_NAME='mylanguage',
LANGUAGE_COOKIE_AGE=3600 * 7 * 2,
LANGUAGE_COOKIE_DOMAIN='.example.com',
@@ -193,9 +193,13 @@ class JsI18NTestsMultiPackage(TestCase):
self.assertContains(response, 'este texto de app3 debe ser traducido')
def test_i18n_with_locale_paths(self):
- extended_locale_paths = settings.LOCALE_PATHS + (
- path.join(path.dirname(
- path.dirname(path.abspath(upath(__file__)))), 'app3', 'locale'),)
+ extended_locale_paths = settings.LOCALE_PATHS + [
+ path.join(
+ path.dirname(path.dirname(path.abspath(upath(__file__)))),
+ 'app3',
+ 'locale',
+ ),
+ ]
with self.settings(LANGUAGE_CODE='es-ar', LOCALE_PATHS=extended_locale_paths):
with override('es-ar'):
response = self.client.get('/jsi18n/')