Closes #19944: Add multi-scenario CSV import testing support with cleanup #1290

Closed
opened 2026-04-05 23:02:18 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jnovinger on 9/9/2025

Closes #19944

  • Enhanced BulkImportObjectsViewTestCase to support multiple CSV import scenarios via dictionary format, where each scenario runs as a separate subtest with automatic cleanup. This enables testing different import configurations (e.g., with/without optional fields) in a single test run with clear output showing which scenario is being tested.
  • Introduces cleanupSubTest() context manager that uses database savepoints to automatically roll back changes between subtests, providing test isolation similar to separate test methods. This allows subtests to create/modify objects without affecting subsequent subtests in the same test method.
*Originally created by @jnovinger on 9/9/2025* Closes #19944 - Enhanced `BulkImportObjectsViewTestCase` to support multiple CSV import scenarios via dictionary format, where each scenario runs as a separate subtest with automatic cleanup. This enables testing different import configurations (e.g., with/without optional fields) in a single test run with clear output showing which scenario is being tested. - Introduces `cleanupSubTest()` context manager that uses database savepoints to automatically roll back changes between subtests, providing test isolation similar to separate test methods. This allows subtests to create/modify objects without affecting subsequent subtests in the same test method.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1290