ExamplePostgresWrapper¶
-
class
tests.test_postgres.ExamplePostgresWrapper(*args, **kwargs)[source]¶ A wrapper around
PostgresWrapperandTestWrapperMixinfor use in Postgres tests.Sets the default database to
privex_py_dbCreates the table
usersIncludes two helper query methods
insert_user()andfind_user()
-
__init__(*args, **kwargs)[source] Initialise the database wrapper class.
- Parameters
- Key str db_schema
(Default:
'public') Schema used for querying table existence- Key str query_mode
Either
'flat'(query returns tuples) or'dict'(query returns dicts). More details in PyDoc block underquery_mode- Key psycopg2.extensions.cursor cursor_cls
If necessary, you may override the Psycopg2 cursor class used by specifying this kwarg. If this isn’t specified,
cursor_clswill default to eitherpsycopg2.extras.RealDictCursorif query_mode isdict, orpsycopg2.extras.NamedTupleCursorif query_mode isflat.
Methods¶
Methods
|
Initialise the database wrapper class. |
|
|
|