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 using PostgresQueryBuilder

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 on PostgresQueryBuilder

Methods

Methods

test_all_call()

Insert two users, then verify they’re returned from an .all() call using PostgresQueryBuilder

test_generator_builder()

Test obtaining PostgresBuilder results by calling next() on the builder object (like a generator)

test_group_call()

Insert 5 users with 3 “John”s, then run a select+where+group_by query and confirm COUNT returns 3 johns

test_index_builder()

Test obtaining PostgresBuilder results by accessing an index of the builder object

test_iterate_builder()

Test obtaining PostgresBuilder results by iterating over the builder object itself with a for loop

test_query_all()

Build a select all query using PostgresQueryBuilder and confirm the built query looks correct

test_query_select_col_where()

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()

Build a complex select+where+group_by query using PostgresQueryBuilder and confirm the built query looks correct

test_query_select_col_where_order()

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()

Build a ‘where AND’ query using PostgresQueryBuilder and confirm the built query looks correct

test_where_call()

Insert three users, then retrieve Dave using .where() + .fetch() call on PostgresQueryBuilder

Attributes

Attributes

pytestmark