mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-08 13:00:08 -06:00
Address PR feedback
This commit is contained in:
@@ -2340,8 +2340,7 @@ class DeviceTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|||||||
url = reverse('dcim:device_inventory', kwargs={'pk': device.pk})
|
url = reverse('dcim:device_inventory', kwargs={'pk': device.pk})
|
||||||
self.assertHttpStatus(self.client.get(url), 200)
|
self.assertHttpStatus(self.client.get(url), 200)
|
||||||
|
|
||||||
@tag('regression') # #20929
|
def test_device_renderconfig(self):
|
||||||
def test_device_renderconfig_permission(self):
|
|
||||||
configtemplate = ConfigTemplate.objects.create(
|
configtemplate = ConfigTemplate.objects.create(
|
||||||
name='Test Config Template',
|
name='Test Config Template',
|
||||||
template_code='Config for device {{ device.name }}'
|
template_code='Config for device {{ device.name }}'
|
||||||
|
|||||||
@@ -73,11 +73,9 @@ class TestCase(_TestCase):
|
|||||||
"""
|
"""
|
||||||
for name in names:
|
for name in names:
|
||||||
object_type, action = resolve_permission_type(name)
|
object_type, action = resolve_permission_type(name)
|
||||||
obj_perms = ObjectPermission.objects.filter(
|
ObjectPermission.objects.filter(
|
||||||
actions__contains=[action], object_types=object_type, users=self.user
|
actions__contains=[action], object_types=object_type, users=self.user
|
||||||
)
|
).delete()
|
||||||
for obj_perm in obj_perms:
|
|
||||||
obj_perm.users.remove(self.user)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Custom assertions
|
# Custom assertions
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.test import override_settings, tag
|
from django.test import override_settings
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from dcim.choices import InterfaceModeChoices
|
from dcim.choices import InterfaceModeChoices
|
||||||
@@ -327,8 +327,7 @@ class VirtualMachineTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|||||||
url = reverse('virtualization:virtualmachine_interfaces', kwargs={'pk': virtualmachine.pk})
|
url = reverse('virtualization:virtualmachine_interfaces', kwargs={'pk': virtualmachine.pk})
|
||||||
self.assertHttpStatus(self.client.get(url), 200)
|
self.assertHttpStatus(self.client.get(url), 200)
|
||||||
|
|
||||||
@tag('regression') # #20929
|
def test_virtualmachine_renderconfig(self):
|
||||||
def test_virtualmachine_renderconfig_permission(self):
|
|
||||||
configtemplate = ConfigTemplate.objects.create(
|
configtemplate = ConfigTemplate.objects.create(
|
||||||
name='Test Config Template',
|
name='Test Config Template',
|
||||||
template_code='Config for VM {{ virtualmachine.name }}'
|
template_code='Config for VM {{ virtualmachine.name }}'
|
||||||
|
|||||||
Reference in New Issue
Block a user