From a8155af4e95e7907af673db229ea63c6ab14bdbb Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 24 Dec 2009 05:57:43 +0000 Subject: [PATCH] Fixed #12428: Ensured that the dummy backend is installed correctly on a fresh project generated by django-admin.py startproject. Thanks to Simon for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11974 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/dummy/base.py | 7 +++++-- django/db/utils.py | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/django/db/backends/dummy/base.py b/django/db/backends/dummy/base.py index e3ab4564ea6..b1385aaeb8c 100644 --- a/django/db/backends/dummy/base.py +++ b/django/db/backends/dummy/base.py @@ -41,13 +41,16 @@ class DatabaseWrapper(object): _commit = complain _rollback = ignore - def __init__(self, *args, **kwargs): + def __init__(self, settings_dict, alias, *args, **kwargs): self.features = BaseDatabaseFeatures() self.ops = DatabaseOperations() self.client = DatabaseClient(self) self.creation = BaseDatabaseCreation(self) self.introspection = DatabaseIntrospection(self) - self.validation = BaseDatabaseValidation() + self.validation = BaseDatabaseValidation(self) + + self.settings_dict = settings_dict + self.alias = alias def close(self): pass diff --git a/django/db/utils.py b/django/db/utils.py index 8c0b6771566..0be40daeca6 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -55,7 +55,9 @@ class ConnectionHandler(object): conn = self.databases[alias] except KeyError: raise ConnectionDoesNotExist("The connection %s doesn't exist" % alias) - conn.setdefault('ENGINE', 'dummy') + conn.setdefault('ENGINE', 'django.db.backends.dummy') + if conn['ENGINE'] == 'django.db.backends.': + conn['ENGINE'] = 'django.db.backends.dummy' conn.setdefault('OPTIONS', {}) conn.setdefault('TEST_CHARSET', None) conn.setdefault('TEST_COLLATION', None)