@@ -376,7 +376,7 @@ def doCleanups(cls):
376376 remove_all_role_mappings ()
377377
378378
379- class TestDocumentListAPI (APITestCase ):
379+ class TestDocumentListAPI (APITestCase , TestUtilsMixin ):
380380
381381 @classmethod
382382 def setUpTestData (cls ):
@@ -441,6 +441,32 @@ def test_returns_docs_to_project_member_filtered_to_completed(self):
441441 password = self .project_member_pass ,
442442 expected_num_results = 2 )
443443
444+ def test_returns_docs_to_project_member_filtered_to_active_with_collaborative_annotation (self ):
445+ self ._test_list ('{}?doc_annotations__isnull=true' .format (self .url ),
446+ username = self .super_user_name ,
447+ password = self .super_user_pass ,
448+ expected_num_results = 3 )
449+
450+ self ._patch_project (self .main_project , 'collaborative_annotation' , True )
451+
452+ self ._test_list ('{}?doc_annotations__isnull=true' .format (self .url ),
453+ username = self .super_user_name ,
454+ password = self .super_user_pass ,
455+ expected_num_results = 1 )
456+
457+ def test_returns_docs_to_project_member_filtered_to_completed_with_collaborative_annotation (self ):
458+ self ._test_list ('{}?doc_annotations__isnull=false' .format (self .url ),
459+ username = self .super_user_name ,
460+ password = self .super_user_pass ,
461+ expected_num_results = 0 )
462+
463+ self ._patch_project (self .main_project , 'collaborative_annotation' , True )
464+
465+ self ._test_list ('{}?doc_annotations__isnull=false' .format (self .url ),
466+ username = self .super_user_name ,
467+ password = self .super_user_pass ,
468+ expected_num_results = 2 )
469+
444470 def test_returns_docs_in_consistent_order_for_all_users (self ):
445471 self .client .login (username = self .project_member_name , password = self .project_member_pass )
446472 user1_documents = self .client .get (self .url , format = 'json' ).json ().get ('results' )
0 commit comments