Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14921 -- Tweak changes made in r14861 for the Oracle backend s…

…o the test runner can actually create the test DB. Thanks Karen for the report.

In Oracle, the name of a DB as handled by Django hasn't a counterpart anyway. So use the 'production DB name' as it was done before.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14993 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c2657d892396c51448432637a855eb9ecac5363c 1 parent df6ad35
Ramiro Morales authored December 21, 2010
2  django/db/backends/creation.py
@@ -374,7 +374,7 @@ def create_test_db(self, verbosity=1, autoclobber=False):
374 374
 
375 375
     def _get_test_db_name(self):
376 376
         """
377  
-        Internal implementation - returns the name of the test DB that wll be
  377
+        Internal implementation - returns the name of the test DB that will be
378 378
         created. Only useful when called from create_test_db() and
379 379
         _create_test_db() and when no external munging is done with the 'NAME'
380 380
         or 'TEST_NAME' settings.
12  django/db/backends/oracle/creation.py
@@ -43,7 +43,7 @@ def __init__(self, connection):
43 43
         super(DatabaseCreation, self).__init__(connection)
44 44
 
45 45
     def _create_test_db(self, verbosity=1, autoclobber=False):
46  
-        TEST_NAME = self._get_test_db_name()
  46
+        TEST_NAME = self._test_database_name()
47 47
         TEST_USER = self._test_database_user()
48 48
         TEST_PASSWD = self._test_database_passwd()
49 49
         TEST_TBLSPACE = self._test_database_tblspace()
@@ -201,7 +201,7 @@ def _execute_statements(self, cursor, statements, parameters, verbosity):
201 201
                 sys.stderr.write("Failed (%s)\n" % (err))
202 202
                 raise
203 203
 
204  
-    def _get_test_db_name(self):
  204
+    def _test_database_name(self):
205 205
         name = TEST_DATABASE_PREFIX + self.connection.settings_dict['NAME']
206 206
         try:
207 207
             if self.connection.settings_dict['TEST_NAME']:
@@ -251,3 +251,11 @@ def _test_database_tblspace_tmp(self):
251 251
         except KeyError:
252 252
             pass
253 253
         return name
  254
+
  255
+    def _get_test_db_name(self):
  256
+        """
  257
+        We need to return the 'production' DB name to get the test DB creation
  258
+        machinery to work. This isn't a great deal in this case because DB
  259
+        names as handled by Django haven't real counterparts in Oracle.
  260
+        """
  261
+        return self.connection.settings_dict['NAME']

0 notes on commit c2657d8

Please sign in to comment.
Something went wrong with that request. Please try again.