- Add fpdf2 dependency for dynamic test PDF generation
- Create tests/test_external_integrations.py with end-to-end pipeline tests:
- OpenAI: key validation, metadata extraction via chat completion
- Azure Document Intelligence: admin connectivity, full OCR on generated PDF
- S3: bucket access, upload/download/delete pipeline
- Dropbox: token refresh, upload/download/delete pipeline
- OneDrive: token refresh, upload/download/delete pipeline
- Authentik: OIDC discovery endpoint, credential consistency
- Full pipeline: Azure OCR → OpenAI metadata extraction
- Update tests/conftest.py to capture original env vars before test overrides
- Add has_real_env() helper and original_env fixture for credential detection
- All external tests use @pytest.mark.requires_external and skipif guards
- Test files are dynamically generated with unique content per run
- Uploaded test files are cleaned up in finally blocks
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
- Import all models (DocumentMetadata, FileRecord, ProcessingLog) in conftest.py to register them with SQLAlchemy Base
- Override all three get_db functions used across the app (app.database, app.api.common, app.views.base) to ensure tests use the test database
- Fixes 21 of 24 failing tests (from "no such table" errors to passing)
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>