From 0543f33bbcc48e7dd8d977b77b0377c1928fcacb Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 11 Mar 2009 05:48:26 +0000 Subject: [PATCH] Fixed the django.contrib.gis test database creation as well. Refs r10026 and r10027. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10028 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/db/backend/postgis/creation.py | 5 ++++- django/db/backends/creation.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/django/contrib/gis/db/backend/postgis/creation.py b/django/contrib/gis/db/backend/postgis/creation.py index a53ec71d40..113416de38 100644 --- a/django/contrib/gis/db/backend/postgis/creation.py +++ b/django/contrib/gis/db/backend/postgis/creation.py @@ -140,7 +140,10 @@ def create_spatial_db(test=False, verbosity=1, autoclobber=False, interactive=Fa # Closing the connection connection.close() settings.DATABASE_NAME = db_name - settings.DATABASE_SUPPORTS_TRANSACTIONS = connection.creation._rollback_works() + connection.settings_dict["DATABASE_NAME"] = db_name + can_rollback = connection.creation._rollback_works() + settings.DATABASE_SUPPORTS_TRANSACTIONS = can_rollback + connection.settings_dict["DATABASE_SUPPORTS_TRANSACTIONS"] = can_rollback # Syncing the database call_command('syncdb', verbosity=verbosity, interactive=interactive) diff --git a/django/db/backends/creation.py b/django/db/backends/creation.py index c48cad6a7d..b338a342ef 100644 --- a/django/db/backends/creation.py +++ b/django/db/backends/creation.py @@ -322,8 +322,9 @@ class BaseDatabaseCreation(object): self.connection.close() settings.DATABASE_NAME = test_database_name self.connection.settings_dict["DATABASE_NAME"] = test_database_name - settings.DATABASE_SUPPORTS_TRANSACTIONS = self._rollback_works() - self.connection.settings_dict["DATABASE_SUPPORTS_TRANSACTIONS"] = self._rollback_works() + can_rollback = self._rollback_works() + settings.DATABASE_SUPPORTS_TRANSACTIONS = can_rollback + self.connection.settings_dict["DATABASE_SUPPORTS_TRANSACTIONS"] = can_rollback call_command('syncdb', verbosity=verbosity, interactive=False)