l.t.dbuser : module documentation

Part of lp.testing

Provides a context manager to run parts of a test as a different dbuser.
Function update_store_connections Update the connection settings for all active stores.
Function switch_dbuser Change the current database user.
Function dbuser A context manager that temporarily changes the dbuser.
Function lp_dbuser A context manager that temporarily changes to the launchpad dbuser.
def update_store_connections():
Update the connection settings for all active stores.

This is required for connection setting changes to be made visible.

Unlike disconnect_stores and reconnect_stores, this changes the underlying connection of existing stores, leaving existing objects functional.

def switch_dbuser(new_name):
Change the current database user.

If new_name is None, the default will be restored.

@contextmanager
def dbuser(temporary_name):
A context manager that temporarily changes the dbuser.

Use with the LaunchpadZopelessLayer layer and subclasses.

temporary_name is the name of the dbuser that should be in place for the code in the "with" block.

def lp_dbuser():
A context manager that temporarily changes to the launchpad dbuser.

Use with the LaunchpadZopelessLayer layer and subclasses.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.