diff --git a/nautobot_device_lifecycle_mgmt/tests/test_api.py b/nautobot_device_lifecycle_mgmt/tests/test_api.py index f7acf182..4eb766d0 100644 --- a/nautobot_device_lifecycle_mgmt/tests/test_api.py +++ b/nautobot_device_lifecycle_mgmt/tests/test_api.py @@ -286,6 +286,8 @@ def setUpTestData(cls): # pylint: disable=invalid-name Role.objects.get_or_create(name="router", color="ff0000")[0], Role.objects.get_or_create(name="switch", color="ffff00")[0], ) + for devicerole in deviceroles: + devicerole.content_types.add(ContentType.objects.get_for_model(Device)) devicetypes = ( DeviceType.objects.create(manufacturer=manufacturer, model="ASR-1000"), DeviceType.objects.create(manufacturer=manufacturer, model="Catalyst 6500"), @@ -564,6 +566,7 @@ def setUpTestData(cls): # pylint: disable=too-many-locals,invalid-name name="Location1", location_type=location_type_location_a, status=location_status ) devicerole, _ = Role.objects.get_or_create(name="router", color="ff0000") + devicerole.content_types.add(ContentType.objects.get_for_model(Device)) devicetypes_cisco = ( DeviceType.objects.create(manufacturer=manufacturer_cisco, model="ASR-1000"), DeviceType.objects.create(manufacturer=manufacturer_cisco, model="Catalyst 6500"), diff --git a/nautobot_device_lifecycle_mgmt/tests/test_filters.py b/nautobot_device_lifecycle_mgmt/tests/test_filters.py index bf2a01ac..8da66c08 100644 --- a/nautobot_device_lifecycle_mgmt/tests/test_filters.py +++ b/nautobot_device_lifecycle_mgmt/tests/test_filters.py @@ -46,6 +46,7 @@ def setUp(self): DeviceType.objects.get_or_create(model="c9300-48", manufacturer=self.manufacturer)[0], ) self.devicerole, _ = Role.objects.get_or_create(name="switch", color="ff0000") + self.devicerole.content_types.add(ContentType.objects.get_for_model(Device)) location_type_location_a, _ = LocationType.objects.get_or_create(name="LocationA") location_type_location_a.content_types.add( ContentType.objects.get_for_model(Device), diff --git a/nautobot_device_lifecycle_mgmt/tests/test_forms.py b/nautobot_device_lifecycle_mgmt/tests/test_forms.py index 79bec5a1..f50aee9b 100644 --- a/nautobot_device_lifecycle_mgmt/tests/test_forms.py +++ b/nautobot_device_lifecycle_mgmt/tests/test_forms.py @@ -22,6 +22,7 @@ def setUp(self): self.manufacturer, _ = Manufacturer.objects.get_or_create(name="Cisco") self.device_type, _ = DeviceType.objects.get_or_create(model="c9300-24", manufacturer=self.manufacturer) self.devicerole, _ = Role.objects.get_or_create(name="backbone-switch") + self.devicerole.content_types.add(ContentType.objects.get_for_model(Device)) location_type_location_a, _ = LocationType.objects.get_or_create(name="LocationA") location_type_location_a.content_types.add( ContentType.objects.get_for_model(Device), diff --git a/nautobot_device_lifecycle_mgmt/tests/test_software_filters.py b/nautobot_device_lifecycle_mgmt/tests/test_software_filters.py index 1978f189..1729bc83 100644 --- a/nautobot_device_lifecycle_mgmt/tests/test_software_filters.py +++ b/nautobot_device_lifecycle_mgmt/tests/test_software_filters.py @@ -26,6 +26,7 @@ def setUp(self): self.devicetype_2, _ = DeviceType.objects.get_or_create(manufacturer=manufacturer_arista, model="7150S") self.devicetype_3, _ = DeviceType.objects.get_or_create(manufacturer=manufacturer_arista, model="7500") devicerole, _ = Role.objects.get_or_create(name="switch", color="ff0000") + devicerole.content_types.add(ContentType.objects.get_for_model(Device)) device_status = Status.objects.get_for_model(Device).first() location_type_location_a, _ = LocationType.objects.get_or_create(name="LocationA") location_type_location_a.content_types.add( @@ -180,6 +181,7 @@ def setUp(self): self.devicetype_1, _ = DeviceType.objects.get_or_create(manufacturer=manufacturer_arista, model="7124") devicerole, _ = Role.objects.get_or_create(name="switch", color="ff0000") + devicerole.content_types.add(ContentType.objects.get_for_model(Device)) device_status = Status.objects.get_for_model(Device).first() location_type_location_a, _ = LocationType.objects.get_or_create(name="LocationA") location_type_location_a.content_types.add(