Skip to content

Expand quick-add regression test coverage #20552

@jnovinger

Description

@jnovinger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxtype: housekeepingChanges to the application which do not directly impact the end user

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions