From 9ec8aa5e5d42ac4529846f7eae6bf4982800abff Mon Sep 17 00:00:00 2001 From: darkryder Date: Wed, 21 Jan 2015 22:25:57 +0530 Subject: [PATCH] Fixed #24149 -- Normalized tuple settings to lists. --- django/conf/__init__.py | 5 +- django/conf/global_settings.py | 80 ++++++------ django/conf/locale/ca/formats.py | 8 +- django/conf/locale/cs/formats.py | 12 +- django/conf/locale/cy/formats.py | 8 +- django/conf/locale/da/formats.py | 8 +- django/conf/locale/de/formats.py | 8 +- django/conf/locale/de_CH/formats.py | 8 +- django/conf/locale/el/formats.py | 8 +- django/conf/locale/en/formats.py | 8 +- django/conf/locale/en_AU/formats.py | 8 +- django/conf/locale/en_GB/formats.py | 8 +- django/conf/locale/eo/formats.py | 12 +- django/conf/locale/es/formats.py | 8 +- django/conf/locale/es_AR/formats.py | 8 +- django/conf/locale/es_MX/formats.py | 8 +- django/conf/locale/es_NI/formats.py | 8 +- django/conf/locale/es_PR/formats.py | 8 +- django/conf/locale/fi/formats.py | 12 +- django/conf/locale/fr/formats.py | 12 +- django/conf/locale/hr/formats.py | 8 +- django/conf/locale/hu/formats.py | 12 +- django/conf/locale/id/formats.py | 12 +- django/conf/locale/it/formats.py | 8 +- django/conf/locale/ka/formats.py | 8 +- django/conf/locale/ko/formats.py | 12 +- django/conf/locale/lt/formats.py | 12 +- django/conf/locale/lv/formats.py | 12 +- django/conf/locale/mk/formats.py | 8 +- django/conf/locale/ml/formats.py | 8 +- django/conf/locale/nb/formats.py | 8 +- django/conf/locale/nl/formats.py | 12 +- django/conf/locale/nn/formats.py | 8 +- django/conf/locale/pl/formats.py | 8 +- django/conf/locale/pt/formats.py | 8 +- django/conf/locale/pt_BR/formats.py | 8 +- django/conf/locale/ru/formats.py | 8 +- django/conf/locale/sk/formats.py | 8 +- django/conf/locale/sl/formats.py | 8 +- django/conf/locale/sr/formats.py | 8 +- django/conf/locale/sr_Latn/formats.py | 8 +- django/conf/locale/sv/formats.py | 8 +- django/conf/locale/tr/formats.py | 8 +- django/conf/locale/zh_Hans/formats.py | 12 +- django/conf/locale/zh_Hant/formats.py | 12 +- .../project_template/project_name/settings.py | 8 +- django/contrib/auth/checks.py | 2 +- django/contrib/auth/tests/settings.py | 8 +- .../contrib/auth/tests/test_auth_backends.py | 54 +++----- .../auth/tests/test_context_processors.py | 2 +- django/contrib/auth/tests/test_forms.py | 12 +- django/contrib/auth/tests/test_remote_user.py | 18 +-- django/contrib/auth/tests/test_signals.py | 2 +- django/contrib/auth/tests/test_templates.py | 2 +- django/contrib/auth/tests/test_views.py | 28 +++-- django/contrib/flatpages/tests/test_csrf.py | 4 +- django/contrib/flatpages/tests/test_forms.py | 4 +- .../flatpages/tests/test_middleware.py | 8 +- .../flatpages/tests/test_templatetags.py | 4 +- django/contrib/flatpages/tests/test_views.py | 8 +- .../core/management/commands/makemessages.py | 2 +- django/templatetags/i18n.py | 2 +- django/utils/formats.py | 8 +- django/views/i18n.py | 2 +- docs/howto/auth-remote-user.txt | 8 +- docs/howto/error-reporting.txt | 10 +- docs/howto/static-files/index.txt | 4 +- .../contributing/writing-documentation.txt | 8 +- docs/intro/reusable-apps.txt | 4 +- docs/intro/tutorial01.txt | 4 +- docs/ref/clickjacking.txt | 4 +- docs/ref/contrib/gis/tutorial.txt | 4 +- docs/ref/settings.txt | 118 +++++++++--------- docs/ref/templates/api.txt | 2 +- docs/ref/templates/upgrading.txt | 4 +- docs/releases/1.9.txt | 6 + docs/topics/auth/customizing.txt | 4 +- docs/topics/auth/passwords.txt | 12 +- docs/topics/cache.txt | 4 +- docs/topics/db/models.txt | 4 +- docs/topics/http/file-uploads.txt | 4 +- docs/topics/http/middleware.txt | 6 +- docs/topics/i18n/translation.txt | 14 +-- docs/topics/testing/overview.txt | 4 +- tests/admin_changelist/tests.py | 2 +- tests/admin_custom_urls/tests.py | 4 +- tests/admin_docs/tests.py | 2 +- tests/admin_inlines/tests.py | 8 +- tests/admin_views/tests.py | 80 ++++++------ tests/admin_widgets/tests.py | 16 +-- tests/cache/tests.py | 4 +- tests/check_framework/tests.py | 2 +- tests/context_processors/tests.py | 2 +- tests/file_uploads/tests.py | 2 +- tests/forms_tests/tests/test_input_formats.py | 2 +- tests/generic_inline_admin/tests.py | 6 +- tests/i18n/contenttypes/tests.py | 8 +- tests/i18n/patterns/tests.py | 16 +-- tests/i18n/test_compilation.py | 10 +- tests/i18n/test_extraction.py | 3 +- tests/i18n/tests.py | 34 ++--- tests/logging_tests/tests.py | 16 +-- tests/mail/tests.py | 2 +- tests/middleware/tests.py | 4 +- tests/middleware_exceptions/tests.py | 8 +- tests/model_regress/test_pickle.py | 2 +- tests/proxy_models/tests.py | 2 +- tests/runtests.py | 6 +- tests/settings_tests/tests.py | 12 +- tests/staticfiles_tests/tests.py | 18 +-- tests/template_tests/test_response.py | 4 +- tests/test_client/tests.py | 4 +- tests/test_client_regress/tests.py | 12 +- tests/test_sqlite.py | 4 +- tests/timezones/tests.py | 2 +- tests/urlpatterns_reverse/tests.py | 24 ++-- tests/utils_tests/test_autoreload.py | 2 +- tests/view_tests/tests/test_csrf.py | 4 +- tests/view_tests/tests/test_debug.py | 6 +- tests/view_tests/tests/test_i18n.py | 12 +- 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 ` 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 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 ``/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 ` 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 ` 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 ` 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 ` 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 `, 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 `:: - 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 ` 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 `.) @@ -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' -@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" % 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, '%d' % (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) 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, '') -@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, '