Repository navigation
Conversation
Move the REST tests to tests/api, the UI tests to test_polymorphic_views, and the model-level tests to tests/models, and move the shared _grant_perm helper to tests/base. Tests move unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@claude /review and report only on actionable issues. |
|
Claude finished @bctiemann's task in 2m 39s —— View job Review: Closes #952 — Split polymorphic field tests by layer
The split is clean and the test logic moves verbatim. Four actionable issues below. 1. Unused
|
|
Thanks. All four are accurate, but each one is already in They'll be handled in the naming and cleanup pass at the end of the NPL-1248 test audit:
|
Closes: #952
Splits
tests/test_polymorphic_fields.py(about 2,300 lines) by layer, as proposed in the NPL-1248 test audit. Each part goes into the package that already holds that layer's tests.tests/api/test_polymorphic_fields.pyPolymorphicFieldAPITest: defining polymorphic fields, and reading and writing their values over RESTtests/test_polymorphic_views.pyPolymorphicFieldUITest: the edit, bulk edit, detail and delete pages and their formstests/models/test_polymorphic_fields.pyPolymorphicThroughModelRegistrationTest,ReferencedObjectDeletionTest,PolymorphicCycleDetectionTest,PolymorphicReverseDescriptorTest,PolymorphicReverseDescriptorRecursionTestCase,GetModelCacheRegistryConsistencyTestCaseThe UI tests stay at the top level next to
test_views.py, since there's no views package.The test classes move unchanged. The only other changes:
_grant_perm, which the API and UI tests both use, moves unchanged totests/base.py, so there's one copy.The cache and registry classes are among those the audit plans to gather into
test_model_cache.py. They sit with the other model-level tests until then.Issue numbers in section comments and class names are left for the naming pass, the audit's last item.
Testing
_grant_permappear verbatim in the new modules (all 88 tests).feature: 1,751 tests without netbox-branching and 1,845 with it (6 skipped), 1 expected failure (Renaming an Object field resets its FK constraint to ON DELETE NO ACTION #892) in each.🤖 Generated with Claude Code