Integration Tests
Explore how to write and run integration tests with PostgreSQL repositories in a clean architecture Python application. Learn to use fixtures and test-driven development to ensure your database interactions work correctly, demonstrating the benefits of layered architecture.
We'll cover the following...
We'll cover the following...
At this point, we can create real tests in the test_postgresrepo.py file and replace our test_dummy function. All tests receive the app_configuration, pg_session, and pg_test_data fixtures. The first fixture allows us to initialize the PostgresRepo class with the proper parameters. The second fixture creates the database with our test data. Finally, the third fixture contains the database.
Impact on our test cases
The tests for ...