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