class documentation

class DatabaseCreation(BaseDatabaseCreation):

View In Hierarchy

Undocumented

Method ​_create​_test​_db Internal implementation - create the test db tables.
Method ​_create​_test​_user Undocumented
Method ​_destroy​_test​_db Destroy a test database, prompting the user for confirmation if the database already exists. Return the name of the test database created.
Method ​_destroy​_test​_user Undocumented
Method ​_execute​_allow​_fail​_statements Execute statements which are allowed to fail silently if the Oracle error code given by acceptable_ora_err is raised. Return True if the statements execute without an exception, or False otherwise.
Method ​_execute​_statements Undocumented
Method ​_execute​_test​_db​_creation Undocumented
Method ​_execute​_test​_db​_destruction Undocumented
Method ​_get​_test​_db​_name 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 don't have real counterparts in Oracle.
Method ​_get​_test​_db​_params Undocumented
Method ​_handle​_objects​_preventing​_db​_destruction Undocumented
Method ​_switch​_to​_test​_user Switch to the user that's used for creating the test database.
Method ​_test​_database​_create Undocumented
Method ​_test​_database​_name Undocumented
Method ​_test​_database​_oracle​_managed​_files Undocumented
Method ​_test​_database​_passwd Undocumented
Method ​_test​_database​_tblspace Undocumented
Method ​_test​_database​_tblspace​_datafile Undocumented
Method ​_test​_database​_tblspace​_extsize Undocumented
Method ​_test​_database​_tblspace​_maxsize Undocumented
Method ​_test​_database​_tblspace​_size Undocumented
Method ​_test​_database​_tblspace​_tmp Undocumented
Method ​_test​_database​_tblspace​_tmp​_datafile Undocumented
Method ​_test​_database​_tblspace​_tmp​_extsize Undocumented
Method ​_test​_database​_tblspace​_tmp​_maxsize Undocumented
Method ​_test​_database​_tblspace​_tmp​_size Undocumented
Method ​_test​_database​_user Undocumented
Method ​_test​_settings​_get Return a value from the test settings dict, or a given default, or a prefixed entry from the main settings dict.
Method ​_test​_user​_create Undocumented
Method set​_as​_test​_mirror Set this database up to be used in testing as a mirror of a primary database whose settings are given.
Method test​_db​_signature Return a tuple with elements of self.connection.settings_dict (a DATABASES setting value) that uniquely identify a database accordingly to the RDBMS particularities.
Property ​_maindb​_connection No summary

Inherited from BaseDatabaseCreation:

Method __init__ Undocumented
Method ​_clone​_test​_db Internal implementation - duplicate the test db tables.
Method ​_execute​_create​_test​_db Undocumented
Method ​_get​_database​_display​_str Return display string for a database for use in various actions.
Method ​_nodb​_cursor Undocumented
Method clone​_test​_db Clone a test database.
Method create​_test​_db Create a test database, prompting the user for confirmation if the database already exists. Return the name of the test database created.
Method deserialize​_db​_from​_string Reload the database with data from a string generated by the serialize_db_to_string() method.
Method destroy​_test​_db Destroy a test database, prompting the user for confirmation if the database already exists.
Method get​_test​_db​_clone​_settings Return a modified connection settings dict for the n-th clone of a DB.
Method log Undocumented
Method mark​_expected​_failures​_and​_skips Mark tests in Django's test suite which are expected failures on this database and test which should be skipped on this database.
Method serialize​_db​_to​_string Serialize all data in the database into a JSON string. Designed only for test runner usage; will not handle large amounts of data.
Method sql​_table​_creation​_suffix SQL to append to the end of the test table creation statements.
Instance Variable connection Undocumented
def _create_test_db(self, verbosity=1, autoclobber=False, keepdb=False):
Internal implementation - create the test db tables.
def _create_test_user(self, cursor, parameters, verbosity, keepdb=False):

Undocumented

def _destroy_test_db(self, test_database_name, verbosity=1):
Destroy a test database, prompting the user for confirmation if the database already exists. Return the name of the test database created.
def _destroy_test_user(self, cursor, parameters, verbosity):

Undocumented

def _execute_allow_fail_statements(self, cursor, statements, parameters, verbosity, acceptable_ora_err):
Execute statements which are allowed to fail silently if the Oracle error code given by acceptable_ora_err is raised. Return True if the statements execute without an exception, or False otherwise.
def _execute_statements(self, cursor, statements, parameters, verbosity, allow_quiet_fail=False):

Undocumented

def _execute_test_db_creation(self, cursor, parameters, verbosity, keepdb=False):

Undocumented

def _execute_test_db_destruction(self, cursor, parameters, verbosity):

Undocumented

def _get_test_db_name(self):
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 don't have real counterparts in Oracle.
def _get_test_db_params(self):

Undocumented

def _handle_objects_preventing_db_destruction(self, cursor, parameters, verbosity, autoclobber):

Undocumented

def _switch_to_test_user(self, parameters):

Switch to the user that's used for creating the test database.

Oracle doesn't have the concept of separate databases under the same user, so a separate user is used; see _create_test_db(). The main user is also needed for cleanup when testing is completed, so save its credentials in the SAVED_USER/SAVED_PASSWORD key in the settings dict.

def _test_database_create(self):

Undocumented

def _test_database_name(self):

Undocumented

def _test_database_oracle_managed_files(self):

Undocumented

def _test_database_passwd(self):

Undocumented

def _test_database_tblspace(self):

Undocumented

def _test_database_tblspace_datafile(self):

Undocumented

def _test_database_tblspace_extsize(self):

Undocumented

def _test_database_tblspace_maxsize(self):

Undocumented

def _test_database_tblspace_size(self):

Undocumented

def _test_database_tblspace_tmp(self):

Undocumented

def _test_database_tblspace_tmp_datafile(self):

Undocumented

def _test_database_tblspace_tmp_extsize(self):

Undocumented

def _test_database_tblspace_tmp_maxsize(self):

Undocumented

def _test_database_tblspace_tmp_size(self):

Undocumented

def _test_database_user(self):

Undocumented

def _test_settings_get(self, key, default=None, prefixed=None):
Return a value from the test settings dict, or a given default, or a prefixed entry from the main settings dict.
def _test_user_create(self):

Undocumented

def set_as_test_mirror(self, primary_settings_dict):
Set this database up to be used in testing as a mirror of a primary database whose settings are given.
def test_db_signature(self):
Return a tuple with elements of self.connection.settings_dict (a DATABASES setting value) that uniquely identify a database accordingly to the RDBMS particularities.
@cached_property
_maindb_connection =
This is analogous to other backends' _nodb_connection property, which allows access to an "administrative" connection which can be used to manage the test databases. For Oracle, the only connection that can be used for that purpose is the main (non-test) connection.