mirror of https://github.com/doccano/doccano.git
pythonannotation-tooldatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learning
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
775 B
21 lines
775 B
from rest_framework import status
|
|
from rest_framework.reverse import reverse
|
|
|
|
from api.models import DOCUMENT_CLASSIFICATION
|
|
from api.tests.api.utils import CRUDMixin, prepare_project
|
|
|
|
|
|
class TestImportCatalog(CRUDMixin):
|
|
|
|
def setUp(self):
|
|
self.project = prepare_project(task=DOCUMENT_CLASSIFICATION)
|
|
self.url = reverse(viewname='catalog', args=[self.project.item.id])
|
|
|
|
def test_allows_project_admin_to_list_catalog(self):
|
|
response = self.assert_fetch(self.project.users[0], status.HTTP_200_OK)
|
|
for item in response.data:
|
|
self.assertIn('name', item)
|
|
|
|
def test_denies_non_project_admin_to_list_catalog(self):
|
|
for member in self.project.users[1:]:
|
|
self.assert_fetch(member, status.HTTP_403_FORBIDDEN)
|