From a028aad84943a79134ae41fa1ccaea0d9f5dfe37 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 21 Mar 2025 10:17:42 -0700 Subject: [PATCH] 18245 fix tests --- netbox/dcim/tests/test_api.py | 2 +- netbox/dcim/tests/test_filtersets.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/tests/test_api.py b/netbox/dcim/tests/test_api.py index 8dfb90482..542040efc 100644 --- a/netbox/dcim/tests/test_api.py +++ b/netbox/dcim/tests/test_api.py @@ -1149,7 +1149,7 @@ class InventoryItemTemplateTest(APIViewTestCases.APIViewTestCase): class DeviceRoleGroupTest(APIViewTestCases.APIViewTestCase): model = DeviceRoleGroup - brief_fields = ['_depth', 'description', 'display', 'id', 'name', 'slug', 'role_count', 'url'] + brief_fields = ['_depth', 'description', 'display', 'id', 'name', 'role_count', 'slug', 'url'] bulk_update_data = { 'description': 'New description', 'comments': 'New Comment', diff --git a/netbox/dcim/tests/test_filtersets.py b/netbox/dcim/tests/test_filtersets.py index d207734ea..a613b3052 100644 --- a/netbox/dcim/tests/test_filtersets.py +++ b/netbox/dcim/tests/test_filtersets.py @@ -2298,6 +2298,13 @@ class DeviceRoleTestCase(TestCase, ChangeLoggedFilterSetTests): params = {'vm_role': 'false'} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + def test_group(self): + group = DeviceRoleGroup.objects.all()[:2] + params = {'group_id': [group[0].pk, group[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) + params = {'group': [group[0].slug, group[1].slug]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) + def test_description(self): params = {'description': ['foobar1', 'foobar2']} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)