Author: ramiro
Date: 2010-12-20 19:36:09 -0600 (Mon, 20 Dec 2010)
New Revision: 14993

Modified:
   django/trunk/django/db/backends/creation.py
   django/trunk/django/db/backends/oracle/creation.py
Log:
Fixed #14921 -- Tweak changes made in r14861 for the Oracle backend so 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.

Modified: django/trunk/django/db/backends/creation.py
===================================================================
--- django/trunk/django/db/backends/creation.py 2010-12-19 23:47:24 UTC (rev 
14992)
+++ django/trunk/django/db/backends/creation.py 2010-12-21 01:36:09 UTC (rev 
14993)
@@ -374,7 +374,7 @@
 
     def _get_test_db_name(self):
         """
-        Internal implementation - returns the name of the test DB that wll be
+        Internal implementation - returns the name of the test DB that will be
         created. Only useful when called from create_test_db() and
         _create_test_db() and when no external munging is done with the 'NAME'
         or 'TEST_NAME' settings.

Modified: django/trunk/django/db/backends/oracle/creation.py
===================================================================
--- django/trunk/django/db/backends/oracle/creation.py  2010-12-19 23:47:24 UTC 
(rev 14992)
+++ django/trunk/django/db/backends/oracle/creation.py  2010-12-21 01:36:09 UTC 
(rev 14993)
@@ -43,7 +43,7 @@
         super(DatabaseCreation, self).__init__(connection)
 
     def _create_test_db(self, verbosity=1, autoclobber=False):
-        TEST_NAME = self._get_test_db_name()
+        TEST_NAME = self._test_database_name()
         TEST_USER = self._test_database_user()
         TEST_PASSWD = self._test_database_passwd()
         TEST_TBLSPACE = self._test_database_tblspace()
@@ -201,7 +201,7 @@
                 sys.stderr.write("Failed (%s)\n" % (err))
                 raise
 
-    def _get_test_db_name(self):
+    def _test_database_name(self):
         name = TEST_DATABASE_PREFIX + self.connection.settings_dict['NAME']
         try:
             if self.connection.settings_dict['TEST_NAME']:
@@ -251,3 +251,11 @@
         except KeyError:
             pass
         return name
+
+    def _get_test_db_name(self):
+        """
+        We need to return the 'production' DB name to get the test DB creation
+        machinery to work. This isn't a great deal in this case because DB
+        names as handled by Django haven't real counterparts in Oracle.
+        """
+        return self.connection.settings_dict['NAME']

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to