Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
progala committed Sep 7, 2023
1 parent 91842f8 commit cda1824
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nautobot_device_lifecycle_mgmt/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down
1 change: 1 addition & 0 deletions nautobot_device_lifecycle_mgmt/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions nautobot_device_lifecycle_mgmt/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 2 additions & 0 deletions nautobot_device_lifecycle_mgmt/tests/test_software_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit cda1824

Please sign in to comment.