Orange County Lettings uses pytest with the pytest-django plugin to run its test suite. pytest-django handles Django setup automatically, including database creation and teardown, so you do not need to configure it manually.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OpenClassrooms-Student-Center/Python-OC-Lettings-FR/llms.txt
Use this file to discover all available pages before exploring further.
Test configuration
The test runner is configured insetup.cfg:
| Option | Description |
|---|---|
DJANGO_SETTINGS_MODULE | Points pytest-django to the project settings file |
python_files | Tells pytest to collect tests from files named tests.py |
addopts | Runs pytest in verbose mode (-v) by default |
pytest-django==3.9.0.
Run the test suite
Current tests
The existing test file atoc_lettings_site/tests.py contains a single placeholder test:
Example: testing a Django view
Use theclient fixture provided by pytest-django to make HTTP requests against your views:
@pytest.mark.django_db marker grants the test access to the database. The client fixture is a Django test.Client instance ready to make requests without starting a real server.