feat(api): Add IndexViewset to ViewSet mixin

ref: #442 #456
This commit is contained in:
2024-12-27 22:30:17 +09:30
parent 62fcb5aa01
commit 193c6c3b7f
17 changed files with 164 additions and 25 deletions

View File

@ -2,6 +2,8 @@ from django.contrib.auth.models import User
from django.shortcuts import reverse
from django.test import Client, TestCase
from rest_framework.permissions import IsAuthenticated
from access.models import Organization
from api.tests.abstract.viewsets import ViewSetCommon
@ -39,4 +41,18 @@ class ITIMViewset(
client.force_login(self.view_user)
self.http_options_response_list = client.options(url)
self.http_options_response_list = client.options(url)
def test_view_attr_permission_classes_value(self):
"""Attribute Test
Attribute `permission_classes` must be metadata class `ReactUIMetadata`
"""
view_set = self.viewset()
assert view_set.permission_classes[0] is IsAuthenticated
assert len(view_set.permission_classes) == 1