You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split tests/test_polymorphic_fields.py (about 2,300 lines) by layer, into the packages that already hold each layer's tests:
tests/api/test_polymorphic_fields.py: PolymorphicFieldAPITest, which covers creating polymorphic fields and reading and writing their values over REST.
tests/test_polymorphic_views.py: PolymorphicFieldUITest, which covers the edit, bulk edit, detail and delete pages and their forms.
tests/models/test_polymorphic_fields.py: the model-level classes. These cover through-model registration, deleting referenced objects, cycle detection, reverse descriptors, get_models() re-entrancy and cache registry consistency.
The _grant_perm helper, used by the API and UI tests, moves to tests/base.py. Tests move unchanged.
Justification
One module mixes REST, UI and model tests, so polymorphic coverage for each layer is hard to find next to that layer's other tests. The NPL-1248 test audit proposed splitting it by layer.
Activity
Closes #952: Split the polymorphic field tests by layer (#953)
Closes netboxlabs#952: Split the polymorphic field tests by layer