TestPostgresBuilder¶
-
class
tests.test_postgres.
TestPostgresBuilder
(methodName='runTest')[source]¶ -
__init__
(methodName='runTest') Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
test_all_call
()[source]¶ Insert two users, then verify they’re returned from an
.all()
call usingPostgresQueryBuilder
-
test_generator_builder
()[source]¶ Test obtaining PostgresBuilder results by calling
next()
on the builder object (like a generator)
-
test_group_call
()[source]¶ Insert 5 users with 3 “John”s, then run a select+where+group_by query and confirm COUNT returns 3 johns
-
test_index_builder
()[source]¶ Test obtaining PostgresBuilder results by accessing an index of the builder object
-
test_iterate_builder
()[source]¶ Test obtaining PostgresBuilder results by iterating over the builder object itself with a for loop
-
test_query_all
()[source]¶ Build a select all query using
PostgresQueryBuilder
and confirm the built query looks correct
-
test_query_select_col_where
()[source]¶ Build a query selecting specific columns plus a ‘where AND’ clause using
PostgresQueryBuilder
and confirm the built query looks correct
-
test_query_select_col_where_group
()[source]¶ Build a complex select+where+group_by query using
PostgresQueryBuilder
and confirm the built query looks correct
-
test_query_select_col_where_order
()[source]¶ Build a query selecting specific columns, a ‘where AND’ clause, and an ‘ORDER BY’ clause using
PostgresQueryBuilder
and confirm the built query looks correct
-
test_query_where_first_name_last_name
()[source]¶ Build a ‘where AND’ query using
PostgresQueryBuilder
and confirm the built query looks correct
-
test_where_call
()[source]¶ Insert three users, then retrieve Dave using
.where()
+.fetch()
call onPostgresQueryBuilder
-
Methods¶
Methods
Insert two users, then verify they’re returned from an |
|
Test obtaining PostgresBuilder results by calling |
|
Insert 5 users with 3 “John”s, then run a select+where+group_by query and confirm COUNT returns 3 johns |
|
Test obtaining PostgresBuilder results by accessing an index of the builder object |
|
Test obtaining PostgresBuilder results by iterating over the builder object itself with a for loop |
|
Build a select all query using |
|
Build a query selecting specific columns plus a ‘where AND’ clause using |
|
Build a complex select+where+group_by query using |
|
Build a query selecting specific columns, a ‘where AND’ clause, and an ‘ORDER BY’ clause using |
|
Build a ‘where AND’ query using |
|
Insert three users, then retrieve Dave using |