mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-20 16:01:34 +02:00
15410 removed deprecated filters (#16410)
* 15410 removed legacy filters * 15410 fix tests * 15410 fix tests
This commit is contained in:
@@ -698,9 +698,6 @@ class DeviceTypeComponentFilterSet(django_filters.FilterSet):
|
||||
label=_('Device type (ID)'),
|
||||
)
|
||||
|
||||
# TODO: Remove in v4.1
|
||||
devicetype_id = device_type_id
|
||||
|
||||
def search(self, queryset, name, value):
|
||||
if not value.strip():
|
||||
return queryset
|
||||
@@ -717,9 +714,6 @@ class ModularDeviceTypeComponentFilterSet(DeviceTypeComponentFilterSet):
|
||||
label=_('Module type (ID)'),
|
||||
)
|
||||
|
||||
# TODO: Remove in v4.1
|
||||
moduletype_id = module_type_id
|
||||
|
||||
|
||||
class ConsolePortTemplateFilterSet(ChangeLoggedModelFilterSet, ModularDeviceTypeComponentFilterSet):
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ class DeviceComponentTemplateFilterSetTests:
|
||||
params = {'description': ['foobar1', 'foobar2']}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
||||
def test_devicetype_id(self):
|
||||
def test_device_type_id(self):
|
||||
device_types = DeviceType.objects.all()[:2]
|
||||
params = {'devicetype_id': [device_types[0].pk, device_types[1].pk]}
|
||||
params = {'device_type_id': [device_types[0].pk, device_types[1].pk]}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
||||
|
||||
@@ -1753,9 +1753,9 @@ class InventoryItemTemplateTestCase(TestCase, DeviceComponentTemplateFilterSetTe
|
||||
params = {'name': ['Inventory Item 1', 'Inventory Item 2']}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
||||
def test_devicetype_id(self):
|
||||
def test_device_type_id(self):
|
||||
device_types = DeviceType.objects.all()[:2]
|
||||
params = {'devicetype_id': [device_types[0].pk, device_types[1].pk]}
|
||||
params = {'device_type_id': [device_types[0].pk, device_types[1].pk]}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 4)
|
||||
|
||||
def test_label(self):
|
||||
|
||||
Reference in New Issue
Block a user