-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Proposed Changes
The quick-add regression test added in #20542 currently exists only in dcim/tests/test_views.py::MACAddressTestCase::test_create_macaddress_via_quickadd()
. This test verifies that MAC addresses can be created via the quick-add modal with proper form prefix handling.
However, the bug fixed in #20542 affected ALL quick-add forms across NetBox, not just MAC addresses. The test coverage should be expanded to prevent similar regressions from affecting other models used as quick-add targets.
Implementation Considerations
Not all models are suitable for generic quick-add testing due to complex validation requirements. Any expansion of test coverage will need to account for this, either by limiting tests to known-working models or by designing tests that verify prefix handling without requiring full form validation success.
Related Issues
Discovered while fixing #20542 (quick-add form prefix bug).
Justification
The prefix bug fixed in #20542 broke quick-add forms in NetBox but went undetected because there were no tests for quick-add functionality.
A single model-specific test provides limited protection. If future changes to ObjectEditView
or the quick-add mechanism introduce regressions, they might only be caught if they happen to affect MAC addresses specifically.
Broader test coverage would ensure that the quick-add mechanism remains functional across all models that support it, regardless of which specific form triggers a future regression.