diff options
| author | Tim Graham <timograham@gmail.com> | 2014-12-26 12:45:40 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-17 09:55:18 -0500 |
| commit | f635d759354842e46901ed1ae1be5f5a0b81e567 (patch) | |
| tree | 3290dea9edbd45849e9dd525a9aa7f69a75486a8 /django/db/utils.py | |
| parent | d038c547b5ce585cbf9ef5bb7e5298f52e4a243b (diff) | |
Removed support for old-style test database settings per deprecation timeline.
Diffstat (limited to 'django/db/utils.py')
| -rw-r--r-- | django/db/utils.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/django/db/utils.py b/django/db/utils.py index f6e5a9b0f8..ea622cddc6 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -2,11 +2,9 @@ from importlib import import_module import os import pkgutil from threading import local -import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured -from django.utils.deprecation import RemovedInDjango19Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string from django.utils._os import upath @@ -178,13 +176,6 @@ class ConnectionHandler(object): for setting in ['NAME', 'USER', 'PASSWORD', 'HOST', 'PORT']: conn.setdefault(setting, '') - TEST_SETTING_RENAMES = { - 'CREATE': 'CREATE_DB', - 'USER_CREATE': 'CREATE_USER', - 'PASSWD': 'PASSWORD', - } - TEST_SETTING_RENAMES_REVERSE = {v: k for k, v in TEST_SETTING_RENAMES.items()} - def prepare_test_settings(self, alias): """ Makes sure the test settings are available in the 'TEST' sub-dictionary. @@ -194,37 +185,7 @@ class ConnectionHandler(object): except KeyError: raise ConnectionDoesNotExist("The connection %s doesn't exist" % alias) - test_dict_set = 'TEST' in conn test_settings = conn.setdefault('TEST', {}) - old_test_settings = {} - for key, value in six.iteritems(conn): - if key.startswith('TEST_'): - new_key = key[5:] - new_key = self.TEST_SETTING_RENAMES.get(new_key, new_key) - old_test_settings[new_key] = value - - if old_test_settings: - if test_dict_set: - if test_settings != old_test_settings: - raise ImproperlyConfigured( - "Connection '%s' has mismatched TEST and TEST_* " - "database settings." % alias) - else: - test_settings.update(old_test_settings) - for key, _ in six.iteritems(old_test_settings): - warnings.warn("In Django 1.9 the TEST_%s connection setting will be moved " - "to a %s entry in the TEST setting" % - (self.TEST_SETTING_RENAMES_REVERSE.get(key, key), key), - RemovedInDjango19Warning, stacklevel=2) - - for key in list(conn.keys()): - if key.startswith('TEST_'): - del conn[key] - # Check that they didn't just use the old name with 'TEST_' removed - for key, new_key in six.iteritems(self.TEST_SETTING_RENAMES): - if key in test_settings: - warnings.warn("Test setting %s was renamed to %s; specified value (%s) ignored" % - (key, new_key, test_settings[key]), stacklevel=2) for key in ['CHARSET', 'COLLATION', 'NAME', 'MIRROR']: test_settings.setdefault(key, None) |
