Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some Oracle backend test DB creation code bugs.

Made saving of modified settings compatible with multi-db, removed dead and superfluous code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9c619ac48b1e4b61346b97b6838a6efb3416cd70 1 parent 96cc7ba
@ramiro ramiro authored
Showing with 5 additions and 37 deletions.
  1. +5 −37 django/db/backends/oracle/creation.py
View
42 django/db/backends/oracle/creation.py
@@ -1,5 +1,4 @@
import sys, time
-from django.core import management
from django.db.backends.creation import BaseDatabaseCreation
TEST_DATABASE_PREFIX = 'test_'
@@ -39,7 +38,9 @@ class DatabaseCreation(BaseDatabaseCreation):
'URLField': 'VARCHAR2(%(max_length)s)',
}
- remember = {}
+ def __init__(self, connection):
+ self.remember = {}
+ super(DatabaseCreation, self).__init__(connection)
def _create_test_db(self, verbosity=1, autoclobber=False):
TEST_NAME = self._test_database_name()
@@ -131,9 +132,6 @@ def _destroy_test_db(self, test_database_name, verbosity=1):
'tblspace_temp': TEST_TBLSPACE_TMP,
}
- self.remember['user'] = self.connection.settings_dict['USER']
- self.remember['passwd'] = self.connection.settings_dict['PASSWORD']
-
cursor = self.connection.cursor()
time.sleep(1) # To avoid "database is being accessed by other users" errors.
if self._test_user_create():
@@ -210,35 +208,13 @@ def _test_database_name(self):
name = self.connection.settings_dict['TEST_NAME']
except AttributeError:
pass
- except:
- raise
return name
def _test_database_create(self):
- name = True
- try:
- if self.connection.settings_dict['TEST_CREATE']:
- name = True
- else:
- name = False
- except KeyError:
- pass
- except:
- raise
- return name
+ return self.connection.settings_dict.get('TEST_CREATE', True)
def _test_user_create(self):
- name = True
- try:
- if self.connection.settings_dict['TEST_USER_CREATE']:
- name = True
- else:
- name = False
- except KeyError:
- pass
- except:
- raise
- return name
+ return self.connection.settings_dict.get('TEST_USER_CREATE', True)
def _test_database_user(self):
name = TEST_DATABASE_PREFIX + self.connection.settings_dict['USER']
@@ -247,8 +223,6 @@ def _test_database_user(self):
name = self.connection.settings_dict['TEST_USER']
except KeyError:
pass
- except:
- raise
return name
def _test_database_passwd(self):
@@ -258,8 +232,6 @@ def _test_database_passwd(self):
name = self.connection.settings_dict['TEST_PASSWD']
except KeyError:
pass
- except:
- raise
return name
def _test_database_tblspace(self):
@@ -269,8 +241,6 @@ def _test_database_tblspace(self):
name = self.connection.settings_dict['TEST_TBLSPACE']
except KeyError:
pass
- except:
- raise
return name
def _test_database_tblspace_tmp(self):
@@ -280,6 +250,4 @@ def _test_database_tblspace_tmp(self):
name = self.connection.settings_dict['TEST_TBLSPACE_TMP']
except KeyError:
pass
- except:
- raise
return name
Please sign in to comment.
Something went wrong with that request. Please try again.