|
|
@ -376,7 +376,7 @@ class TestLabelDetailAPI(APITestCase): |
|
|
|
remove_all_role_mappings() |
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentListAPI(APITestCase): |
|
|
|
class TestDocumentListAPI(APITestCase, TestUtilsMixin): |
|
|
|
|
|
|
|
@classmethod |
|
|
|
def setUpTestData(cls): |
|
|
@ -441,6 +441,32 @@ class TestDocumentListAPI(APITestCase): |
|
|
|
password=self.project_member_pass, |
|
|
|
expected_num_results=2) |
|
|
|
|
|
|
|
def test_returns_docs_to_project_member_filtered_to_active_with_collaborative_annotation(self): |
|
|
|
self._test_list('{}?doc_annotations__isnull=true'.format(self.url), |
|
|
|
username=self.super_user_name, |
|
|
|
password=self.super_user_pass, |
|
|
|
expected_num_results=3) |
|
|
|
|
|
|
|
self._patch_project(self.main_project, 'collaborative_annotation', True) |
|
|
|
|
|
|
|
self._test_list('{}?doc_annotations__isnull=true'.format(self.url), |
|
|
|
username=self.super_user_name, |
|
|
|
password=self.super_user_pass, |
|
|
|
expected_num_results=1) |
|
|
|
|
|
|
|
def test_returns_docs_to_project_member_filtered_to_completed_with_collaborative_annotation(self): |
|
|
|
self._test_list('{}?doc_annotations__isnull=false'.format(self.url), |
|
|
|
username=self.super_user_name, |
|
|
|
password=self.super_user_pass, |
|
|
|
expected_num_results=0) |
|
|
|
|
|
|
|
self._patch_project(self.main_project, 'collaborative_annotation', True) |
|
|
|
|
|
|
|
self._test_list('{}?doc_annotations__isnull=false'.format(self.url), |
|
|
|
username=self.super_user_name, |
|
|
|
password=self.super_user_pass, |
|
|
|
expected_num_results=2) |
|
|
|
|
|
|
|
def test_returns_docs_in_consistent_order_for_all_users(self): |
|
|
|
self.client.login(username=self.project_member_name, password=self.project_member_pass) |
|
|
|
user1_documents = self.client.get(self.url, format='json').json().get('results') |
|
|
|