ExamplePostgresWrapper¶
-
class
tests.test_postgres.
ExamplePostgresWrapper
(*args, **kwargs)[source]¶ A wrapper around
PostgresWrapper
andTestWrapperMixin
for use in Postgres tests.Sets the default database to
privex_py_db
Creates the table
users
Includes 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_cls
will default to eitherpsycopg2.extras.RealDictCursor
if query_mode isdict
, orpsycopg2.extras.NamedTupleCursor
if query_mode isflat
.
Methods¶
Methods
|
Initialise the database wrapper class. |
|
|
|