Updated the test configuration file to include imports for Trailer, Transporter, and Vehicle models from the transportation module, enhancing the testing capabilities for related functionalities.
- Simplified the index drop and creation logic in the `upgrade` and `downgrade` functions by removing the unnecessary existence check for the `carta_porte_codes` table.
- Updated the `iva_factor` column type in the `invoice_financials` table from VARCHAR to Numeric, enhancing data integrity.
- Improved the overall clarity and efficiency of the migration script.
- Introduced a new fixture, `test_tenant`, to allocate ephemeral tenant and company IDs for tests, reducing conflicts with real data.
- Updated various test functions to use the new `test_tenant` fixture, ensuring consistent tenant ID usage across tests.
- Enhanced the `ensure_tenant_company` function to accept dynamic tenant and company IDs, improving flexibility in test scenarios.
- Adjusted database interaction in tests to utilize the ephemeral IDs, streamlining the setup process and enhancing isolation.
- Added a new function to reject documentation placeholder hosts in database URLs, improving error handling for misconfigurations.
- Updated the `get_database_url` function to incorporate this new validation, ensuring that users are alerted when using "host" as a placeholder.
- Enhanced error messages to provide clearer guidance on valid host configurations.
These changes aim to improve the robustness and clarity of database connection handling in the application.
- Expanded the README.md for backend tests to include a comprehensive overview of the test flow, infrastructure, and edge cases.
- Introduced sections detailing the structure of tests, including integration and unit tests, along with diagrams to illustrate the business flow and common scenarios.
- Enhanced clarity on the setup and execution of tests, including database handling and security measures during testing.
- This update aims to improve understanding and maintainability of the testing framework for future contributors.
- Introduced a new helper function `_ensure_client_provider_address` to manage the assignment of addresses for ClientProvider instances.
- Refactored the `create_business_catalogs` function to utilize the new helper, ensuring that existing addresses are reused if available, preventing duplicate entries.
- This change enhances the integrity of address data during business catalog creation by ensuring proper address assignment based on existing records.
- Introduced a new job in the CI workflow to run backend tests before the build process.
- Configured Python environment and installed dependencies from the backend requirements.
- Added a check for the TEST_DATABASE_URL secret to ensure it is defined before running tests.
- The test job must pass for the build job to execute, enhancing the reliability of the CI pipeline.