- Deleted the `import_plans.py`, `run_tests.py`, and `test_run.py` scripts as they are no longer needed. - Updated the initial migration dependency in `0001_initial.py` to reflect recent changes in the `igny8_core_auth` app. - Enhanced the implementation plan documentation to include new phases and updates on the site builder project. - Updated the `vite.config.ts` and `package.json` to integrate testing configurations and dependencies for the site builder.
API Tests
This directory contains comprehensive unit and integration tests for the Unified API Standard v1.0.
Test Structure
Unit Tests
test_response.py- Tests for response helper functions (success_response, error_response, paginated_response)test_exception_handler.py- Tests for custom exception handlertest_permissions.py- Tests for permission classestest_throttles.py- Tests for rate limiting
Integration Tests
test_integration_base.py- Base class with common fixturestest_integration_planner.py- Planner module endpoint teststest_integration_writer.py- Writer module endpoint teststest_integration_system.py- System module endpoint teststest_integration_billing.py- Billing module endpoint teststest_integration_auth.py- Auth module endpoint teststest_integration_errors.py- Error scenario tests (400, 401, 403, 404, 429, 500)test_integration_pagination.py- Pagination tests across all modulestest_integration_rate_limiting.py- Rate limiting integration tests
Running Tests
Run All Tests
python manage.py test igny8_core.api.tests --verbosity=2
Run Specific Test File
python manage.py test igny8_core.api.tests.test_response
python manage.py test igny8_core.api.tests.test_integration_planner
Run Specific Test Class
python manage.py test igny8_core.api.tests.test_response.ResponseHelpersTestCase
Run Specific Test Method
python manage.py test igny8_core.api.tests.test_response.ResponseHelpersTestCase.test_success_response_with_data
Test Coverage
Unit Tests Coverage
- ✅ Response helpers (100%)
- ✅ Exception handler (100%)
- ✅ Permissions (100%)
- ✅ Rate limiting (100%)
Integration Tests Coverage
- ✅ Planner module CRUD + AI actions
- ✅ Writer module CRUD + AI actions
- ✅ System module endpoints
- ✅ Billing module endpoints
- ✅ Auth module endpoints
- ✅ Error scenarios (400, 401, 403, 404, 429, 500)
- ✅ Pagination across all modules
- ✅ Rate limiting headers and bypass logic
Test Requirements
All tests verify:
- Unified Response Format: All endpoints return
{success, data/results, message, errors, request_id} - Proper Status Codes: Correct HTTP status codes (200, 201, 400, 401, 403, 404, 429, 500)
- Error Format: Error responses include
error,errors, andrequest_id - Pagination Format: Paginated responses include
success,count,next,previous,results - Request ID: All responses include
request_idfor tracking