mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
18981 fix tests
This commit is contained in:
parent
a307e9e141
commit
b38accac66
@ -1013,14 +1013,16 @@ class DeviceFilterSet(
|
||||
queryset=DeviceType.objects.all(),
|
||||
label=_('Device type (ID)'),
|
||||
)
|
||||
role_id = django_filters.ModelMultipleChoiceFilter(
|
||||
field_name='role_id',
|
||||
role_id = TreeNodeMultipleChoiceFilter(
|
||||
field_name='role',
|
||||
queryset=DeviceRole.objects.all(),
|
||||
lookup_expr='in',
|
||||
label=_('Role (ID)'),
|
||||
)
|
||||
role = django_filters.ModelMultipleChoiceFilter(
|
||||
field_name='role__slug',
|
||||
role = TreeNodeMultipleChoiceFilter(
|
||||
queryset=DeviceRole.objects.all(),
|
||||
field_name='role',
|
||||
lookup_expr='in',
|
||||
to_field_name='slug',
|
||||
label=_('Role (slug)'),
|
||||
)
|
||||
|
@ -2955,9 +2955,13 @@ class ConsolePortTestCase(TestCase, DeviceComponentFilterSetTests, ChangeLoggedF
|
||||
|
||||
module_type = ModuleType.objects.create(manufacturer=manufacturer, model='Module Type 1')
|
||||
|
||||
DeviceRole.objects.create(name='Device Role 1', slug='device-role-1')
|
||||
DeviceRole.objects.create(name='Device Role 2', slug='device-role-2')
|
||||
DeviceRole.objects.create(name='Device Role 3', slug='device-role-3')
|
||||
roles = (
|
||||
DeviceRole(name='Device Role 1', slug='device-role-1'),
|
||||
DeviceRole(name='Device Role 2', slug='device-role-2'),
|
||||
DeviceRole(name='Device Role 3', slug='device-role-3'),
|
||||
)
|
||||
for role in roles:
|
||||
role.save()
|
||||
|
||||
locations = (
|
||||
Location(name='Location 1', slug='location-1', site=sites[0]),
|
||||
|
@ -904,8 +904,8 @@ class ConfigContextTestCase(TestCase, ChangeLoggedFilterSetTests):
|
||||
DeviceRole(name='Device Role 2', slug='device-role-2'),
|
||||
DeviceRole(name='Device Role 3', slug='device-role-3'),
|
||||
)
|
||||
for role in roles:
|
||||
role.save()
|
||||
for device_role in device_roles:
|
||||
device_role.save()
|
||||
|
||||
platforms = (
|
||||
Platform(name='Platform 1', slug='platform-1'),
|
||||
|
Loading…
Reference in New Issue
Block a user