mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fix permissions evaluation for nonstandard tests
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
from django.test import override_settings
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from circuits.choices import *
|
from circuits.choices import *
|
||||||
@ -45,6 +46,7 @@ class ProviderTest(APIViewTestCases.APIViewTestCase):
|
|||||||
)
|
)
|
||||||
Provider.objects.bulk_create(providers)
|
Provider.objects.bulk_create(providers)
|
||||||
|
|
||||||
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||||
def test_get_provider_graphs(self):
|
def test_get_provider_graphs(self):
|
||||||
"""
|
"""
|
||||||
Test retrieval of Graphs assigned to Providers.
|
Test retrieval of Graphs assigned to Providers.
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
from django.test import override_settings
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
@ -131,6 +132,7 @@ class SiteTest(APIViewTestCases.APIViewTestCase):
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||||
def test_get_site_graphs(self):
|
def test_get_site_graphs(self):
|
||||||
"""
|
"""
|
||||||
Test retrieval of Graphs assigned to Sites.
|
Test retrieval of Graphs assigned to Sites.
|
||||||
@ -900,6 +902,7 @@ class DeviceTest(APIViewTestCases.APIViewTestCase):
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||||
def test_get_device_graphs(self):
|
def test_get_device_graphs(self):
|
||||||
"""
|
"""
|
||||||
Test retrieval of Graphs assigned to Devices.
|
Test retrieval of Graphs assigned to Devices.
|
||||||
@ -1156,6 +1159,7 @@ class InterfaceTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||||
def test_get_interface_graphs(self):
|
def test_get_interface_graphs(self):
|
||||||
"""
|
"""
|
||||||
Test retrieval of Graphs assigned to Devices.
|
Test retrieval of Graphs assigned to Devices.
|
||||||
|
@ -4,6 +4,7 @@ import pytz
|
|||||||
import yaml
|
import yaml
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
from django.test import override_settings
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from netaddr import EUI
|
from netaddr import EUI
|
||||||
|
|
||||||
@ -376,6 +377,7 @@ class DeviceTypeTestCase(
|
|||||||
'is_full_depth': False,
|
'is_full_depth': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||||
def test_import_objects(self):
|
def test_import_objects(self):
|
||||||
"""
|
"""
|
||||||
Custom import test for YAML-based imports (versus CSV)
|
Custom import test for YAML-based imports (versus CSV)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import base64
|
import base64
|
||||||
|
|
||||||
|
from django.test import override_settings
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
|
from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
|
||||||
@ -96,6 +97,7 @@ class SecretTestCase(
|
|||||||
self.session_key = SessionKey(userkey=userkey)
|
self.session_key = SessionKey(userkey=userkey)
|
||||||
self.session_key.save(master_key)
|
self.session_key.save(master_key)
|
||||||
|
|
||||||
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||||
def test_import_objects(self):
|
def test_import_objects(self):
|
||||||
self.add_permissions('secrets.add_secret')
|
self.add_permissions('secrets.add_secret')
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
from django.test import override_settings
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
@ -244,7 +245,8 @@ class VMInterfaceTest(APIViewTestCases.APIViewTestCase):
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
def test_get_interface_graphs(self):
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||||
|
def test_get_vminterface_graphs(self):
|
||||||
"""
|
"""
|
||||||
Test retrieval of Graphs assigned to VM interfaces.
|
Test retrieval of Graphs assigned to VM interfaces.
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user