test(settings): UserSettings perms tests are not org based, skip those tests

ref: #849 #836
This commit is contained in:
2025-07-04 09:38:34 +09:30
parent ffaac107f4
commit 6e925e8456

View File

@ -0,0 +1,60 @@
import pytest
class AdditionalTestCases:
def test_permission_change(self, model_instance, api_request_permissions):
""" Check correct permission for change
Make change with user who has change permission
"""
client = Client()
client.force_login( api_request_permissions['user']['change'] )
change_item = model_instance(
kwargs_create = {
'organization': api_request_permissions['tenancy']['user']
},
)
response = client.patch(
path = change_item.get_url( many = False ),
data = self.change_data,
content_type = 'application/json'
)
if response.status_code == 405:
pytest.xfail( reason = 'ViewSet does not have this request method.' )
assert response.status_code == 200, response.content
def test_returned_results_only_user_orgs(self):
"""Returned results check
Ensure that a query to the viewset endpoint does not return
items that are not part of the users organizations.
"""
pytest.xfail( reason = 'model is not org based' )
def test_returned_data_from_user_and_global_organizations_only(
self
):
"""Check items returned
Items returned from the query Must be from the users organization and
global ONLY!
"""
pytest.xfail( reason = 'model is not org based' )