@@ -376,7 +376,7 @@ def doCleanups(cls):
376
376
remove_all_role_mappings ()
377
377
378
378
379
- class TestDocumentListAPI (APITestCase ):
379
+ class TestDocumentListAPI (APITestCase , TestUtilsMixin ):
380
380
381
381
@classmethod
382
382
def setUpTestData (cls ):
@@ -441,6 +441,32 @@ def test_returns_docs_to_project_member_filtered_to_completed(self):
441
441
password = self .project_member_pass ,
442
442
expected_num_results = 2 )
443
443
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
+
444
470
def test_returns_docs_in_consistent_order_for_all_users (self ):
445
471
self .client .login (username = self .project_member_name , password = self .project_member_pass )
446
472
user1_documents = self .client .get (self .url , format = 'json' ).json ().get ('results' )
0 commit comments