class documentation

class BaseDatabaseCreation:

Known subclasses: django.db.backends.dummy.base.DatabaseCreation, django.db.backends.mysql.creation.DatabaseCreation, django.db.backends.oracle.creation.DatabaseCreation, django.db.backends.postgresql.creation.DatabaseCreation, django.db.backends.sqlite3.creation.DatabaseCreation

View In Hierarchy

Encapsulate backend-specific differences pertaining to creation and destruction of the test database.
Method __init__ Undocumented
Method ​_clone​_test​_db Internal implementation - duplicate the test db tables.
Method ​_create​_test​_db Internal implementation - create the test db tables.
Method ​_destroy​_test​_db Internal implementation - remove 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 ​_get​_test​_db​_name No summary
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 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 sql​_table​_creation​_suffix SQL to append to the end of the test table creation statements.
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.
Instance Variable connection Undocumented
def __init__(self, connection):

Undocumented

def _clone_test_db(self, suffix, verbosity, keepdb=False):
def _create_test_db(self, verbosity, autoclobber, keepdb=False):
Internal implementation - create the test db tables.
def _destroy_test_db(self, test_database_name, verbosity):
Internal implementation - remove the test db tables.
def _execute_create_test_db(self, cursor, parameters, keepdb=False):
def _get_database_display_str(self, verbosity, database_name):
Return display string for a database for use in various actions.
def _get_test_db_name(self):
Internal implementation - return 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' settings.
def _nodb_cursor(self):

Undocumented

def clone_test_db(self, suffix, verbosity=1, autoclobber=False, keepdb=False):
Clone a test database.
def create_test_db(self, verbosity=1, autoclobber=False, serialize=True, keepdb=False):
Create a test database, prompting the user for confirmation if the database already exists. Return the name of the test database created.
def deserialize_db_from_string(self, data):
Reload the database with data from a string generated by the serialize_db_to_string() method.
def destroy_test_db(self, old_database_name=None, verbosity=1, keepdb=False, suffix=None):
Destroy a test database, prompting the user for confirmation if the database already exists.
def get_test_db_clone_settings(self, suffix):
Return a modified connection settings dict for the n-th clone of a DB.
def log(self, msg):

Undocumented

def mark_expected_failures_and_skips(self):
Mark tests in Django's test suite which are expected failures on this database and test which should be skipped on this database.
def serialize_db_to_string(self):
Serialize all data in the database into a JSON string. Designed only for test runner usage; will not handle large amounts of data.
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 sql_table_creation_suffix(self):
SQL to append to the end of the test table creation statements.
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.
connection =

Undocumented