test(api): API Permissions Auto-Creator test suite

ref: #780 #730 #767
This commit is contained in:
2025-06-01 07:16:04 +09:30
parent 3a010e166e
commit 0abb416620
13 changed files with 261 additions and 80 deletions

View File

@ -277,18 +277,25 @@ The following Unit test suites exists for models:
- Functional Tests
- model `core.tests.functional.centurion_abstract.test_functional_centurion_abstract_model.CenturionAbstractModelInheritedCases`
- API Fields Render `api.tests.functional.test_functional_api_fields.APIFieldsInheritedCases`
- API Permissions `api.tests.functional.test_functional_api_permissions.<permission type>InheriredCases`
Generally Test Cases from class `APIPermissionsInheritedCases` will be used as it covers the standard Django Permissions, `add`, `change`, `delete` and `view`.
!!! info
If you add a feature you will have to [write the test cases](./testing.md) for that feature if they are not covered by existing test cases.
Each model has the following Test Suites auto-magic created:
- API Permissions checks `api.tests.functional.test_functional_meta_permissions_api`
_Checks the CRUD permissions against the models API endpoints_
- Audit History Model checks, `core.tests.unit.centurion_audit_meta.test_unit_meta_audit_history_model`
_Confirms the model has a [`AuditHistory`](./api/models/audit_history.md) model and other checks as required for an `AuditHistory` model._
These auto-magic tests require no input and will be created on a model inheriting from [`CenturionModel`](./api/models/centurion.md) and run every time the tests are run.
## Knowledge Base Article linking