Ver código fonte

Closes #23841: Correct module type import test permissions (#23839)

The test added in #23637 granted
ModuleTypeImportView.additional_permissions, which #23648 removed. The
test now got the base view's empty list and no add_moduletype, so the
import returned 403 and main's tests failed.
bctiemann 13 horas atrás
pai
commit
f86dfe0737
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      netbox/dcim/tests/test_views.py

+ 2 - 2
netbox/dcim/tests/test_views.py

@@ -23,7 +23,7 @@ from core.models import ObjectChange, ObjectType
 from dcim.choices import *
 from dcim.constants import *
 from dcim.models import *
-from dcim.views import DeviceTypeListView, ModuleTypeImportView, ModuleTypeListView
+from dcim.views import DeviceTypeListView, ModuleTypeListView
 from extras.models import ConfigContext, ConfigTemplate
 from ipam.models import ASN, RIR, VLAN, VRF, IPAddress, VLANGroup
 from netbox.choices import (
@@ -1842,7 +1842,7 @@ class ModuleTypeTestCase(ViewTestCases.PrimaryObjectViewTestCase):
     def test_import_update_warns_about_incompatible_installed_modules(self):
         """An import can restrict an existing module type and gives a warning (doesn't remove installed modules)."""
         self.add_permissions(
-            *ModuleTypeImportView.additional_permissions,
+            'dcim.add_moduletype',
             'dcim.change_moduletype',
             'dcim.view_modulebaytype',
         )