diff --git a/django/db/backends/creation.py b/django/db/backends/creation.py index 4c4cf4d044..2baed62855 100644 --- a/django/db/backends/creation.py +++ b/django/db/backends/creation.py @@ -281,6 +281,7 @@ class BaseDatabaseCreation(object): self._create_test_db(verbosity, autoclobber) self.connection.close() + settings.DATABASES[self.connection.alias]["NAME"] = test_database_name self.connection.settings_dict["NAME"] = test_database_name # Report syncdb messages at one level lower than that requested. diff --git a/django/db/backends/oracle/creation.py b/django/db/backends/oracle/creation.py index d9bf3dfea2..1cc3957232 100644 --- a/django/db/backends/oracle/creation.py +++ b/django/db/backends/oracle/creation.py @@ -104,10 +104,12 @@ class DatabaseCreation(BaseDatabaseCreation): print("Tests cancelled.") sys.exit(1) - self.connection.settings_dict['SAVED_USER'] = self.connection.settings_dict['USER'] - self.connection.settings_dict['SAVED_PASSWORD'] = self.connection.settings_dict['PASSWORD'] - self.connection.settings_dict['TEST_USER'] = self.connection.settings_dict['USER'] = TEST_USER - self.connection.settings_dict['PASSWORD'] = TEST_PASSWD + from django.db import settings + real_settings = settings.DATABASES[self.connection.alias] + real_settings['SAVED_USER'] = self.connection.settings_dict['SAVED_USER'] = self.connection.settings_dict['USER'] + real_settings['SAVED_PASSWORD'] = self.connection.settings_dict['SAVED_PASSWORD'] = self.connection.settings_dict['PASSWORD'] + real_settings['TEST_USER'] = real_settings['USER'] = self.connection.settings_dict['TEST_USER'] = self.connection.settings_dict['USER'] = TEST_USER + real_settings['PASSWORD'] = self.connection.settings_dict['PASSWORD'] = TEST_PASSWD return self.connection.settings_dict['NAME']