- Updated AutomationService to include estimated_word_count. - Increased stage_1_batch_size from 20 to 50 in AutomationViewSet. - Changed Keywords model to replace 'intent' property with 'country'. - Adjusted ClusteringService to allow a maximum of 50 keywords for clustering. - Modified admin and management commands to remove 'intent' and use 'country' instead. - Updated serializers to reflect the change from 'intent' to 'country'. - Adjusted views and filters to use 'country' instead of 'intent'. - Updated frontend forms, filters, and pages to replace 'intent' with 'country'. - Added migration to remove 'intent' field and add 'country' field to SeedKeyword model.
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