mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-19 11:52:22 -06:00
* Closes #16107: Set LOGIN_REQUIRED to True by default * Update tests
This commit is contained in:
@@ -73,7 +73,7 @@ class APIViewTestCases:
|
||||
|
||||
class GetObjectViewTestCase(APITestCase):
|
||||
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], LOGIN_REQUIRED=False)
|
||||
def test_get_object_anonymous(self):
|
||||
"""
|
||||
GET a single object as an unauthenticated user.
|
||||
@@ -135,7 +135,7 @@ class APIViewTestCases:
|
||||
class ListObjectsViewTestCase(APITestCase):
|
||||
brief_fields = []
|
||||
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], LOGIN_REQUIRED=False)
|
||||
def test_list_objects_anonymous(self):
|
||||
"""
|
||||
GET a list of objects as an unauthenticated user.
|
||||
|
||||
@@ -62,7 +62,7 @@ class ViewTestCases:
|
||||
"""
|
||||
Retrieve a single instance.
|
||||
"""
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], LOGIN_REQUIRED=False)
|
||||
def test_get_object_anonymous(self):
|
||||
# Make the request as an unauthenticated user
|
||||
self.client.logout()
|
||||
@@ -421,7 +421,7 @@ class ViewTestCases:
|
||||
"""
|
||||
Retrieve multiple instances.
|
||||
"""
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], LOGIN_REQUIRED=False)
|
||||
def test_list_objects_anonymous(self):
|
||||
# Make the request as an unauthenticated user
|
||||
self.client.logout()
|
||||
|
||||
Reference in New Issue
Block a user