Skip to main content

setup_databases

Create the test databases.

def setup_databases(
verbosity: int,
interactive: bool,
time_keeper: TimeKeeper = None,
keepdb: bool = False,
debug_sql: bool = False,
parallel: int = 0,
aliases: set = None,
serialized_aliases: set = None
) - > list

Create the test databases.

Parameters

NameTypeDescription
verbosityintThe level of detail to output during the database creation process.
interactiveboolDetermines if the user should be prompted for confirmation before destroying existing databases.
time_keeperTimeKeeper = NoneAn optional object used to track and record the duration of database creation and cloning operations.
keepdbbool = FalseIf true, preserves the existing test database between test runs instead of recreating it.
debug_sqlbool = FalseIf true, forces the use of a debug cursor on all connections to log SQL statements.
parallelint = 0The number of parallel processes for which to clone the test databases.
aliasesset = NoneA set of database connection aliases to be included in the setup process.
serialized_aliasesset = NoneA set of database aliases that require their state to be serialized for TransactionTestCase support.

Returns

TypeDescription
listA list of tuples containing the connection object, the original database name, and a boolean indicating if it was the primary connection for that database.