mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-15 08:12:18 -06:00
Fixup ModuleTypeTestCase bulk import test to work with callback mechamisn
This commit is contained in:
@@ -1078,14 +1078,14 @@ class ModuleTypeTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|||||||
'dcim.add_modulebaytemplate',
|
'dcim.add_modulebaytemplate',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def verify_module_type_profile(scenario_name):
|
||||||
|
# TODO: remove extra regression asserts once parent test supports testing all import fields
|
||||||
|
fan_module_type = ModuleType.objects.get(part_number='generic-fan')
|
||||||
|
fan_module_type_profile = ModuleTypeProfile.objects.get(name='Fan')
|
||||||
|
assert fan_module_type.profile == fan_module_type_profile
|
||||||
|
|
||||||
# run base test
|
# run base test
|
||||||
super().test_bulk_import_objects_with_permission()
|
super().test_bulk_import_objects_with_permission(post_import_callback=verify_module_type_profile)
|
||||||
|
|
||||||
# TODO: remove extra regression asserts once parent test supports testing all import fields
|
|
||||||
fan_module_type = ModuleType.objects.get(part_number='generic-fan')
|
|
||||||
fan_module_type_profile = ModuleTypeProfile.objects.get(name='Fan')
|
|
||||||
|
|
||||||
assert fan_module_type.profile == fan_module_type_profile
|
|
||||||
|
|
||||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], EXEMPT_EXCLUDE_MODELS=[])
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], EXEMPT_EXCLUDE_MODELS=[])
|
||||||
def test_bulk_import_objects_with_constrained_permission(self):
|
def test_bulk_import_objects_with_constrained_permission(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user