@@ -916,7 +916,8 @@ def test_add_contributors(self, node, auth):
916916 {'user' : user1 , 'permissions' : ADMIN , 'visible' : True },
917917 {'user' : user2 , 'permissions' : WRITE , 'visible' : False }
918918 ],
919- auth = auth
919+ auth = auth ,
920+ notification_type = None
920921 )
921922 last_log = node .logs .all ().order_by ('-date' )[0 ]
922923 assert (
@@ -1114,7 +1115,8 @@ def test_remove_contributors(self, node, auth):
11141115 {'user' : user1 , 'permissions' : permissions .WRITE , 'visible' : True },
11151116 {'user' : user2 , 'permissions' : permissions .WRITE , 'visible' : True }
11161117 ],
1117- auth = auth
1118+ auth = auth ,
1119+ notification_type = None
11181120 )
11191121 assert user1 in node .contributors
11201122 assert user2 in node .contributors
@@ -1232,7 +1234,7 @@ class TestNodeAddContributorRegisteredOrNot:
12321234 def test_add_contributor_user_id (self , user , node ):
12331235 registered_user = UserFactory ()
12341236 with capture_notifications ():
1235- contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), user_id = registered_user ._id )
1237+ contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), user_id = registered_user ._id , notification_type = None )
12361238 contributor = contributor_obj .user
12371239 assert contributor in node .contributors
12381240 assert contributor .is_registered is True
@@ -1241,7 +1243,7 @@ def test_add_contributor_registered_or_not_unreg_user_without_unclaimed_records(
12411243 unregistered_user = UnregUserFactory ()
12421244 unregistered_user .save ()
12431245 with capture_notifications ():
1244- contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), email = unregistered_user .email , full_name = unregistered_user .fullname )
1246+ contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), email = unregistered_user .email , full_name = unregistered_user .fullname , notification_type = None )
12451247
12461248 contributor = contributor_obj .user
12471249 assert contributor in node .contributors
@@ -1260,22 +1262,22 @@ def test_add_contributor_invalid_user_id(self, user, node):
12601262
12611263 def test_add_contributor_fullname_email (self , user , node ):
12621264 with capture_notifications ():
1263- contributor_obj = node .
add_contributor_registered_or_not (
auth = Auth (
user ),
full_name = 'Jane Doe' ,
email = '[email protected] ' )
1265+ contributor_obj = node .
add_contributor_registered_or_not (
auth = Auth (
user ),
full_name = 'Jane Doe' ,
email = '[email protected] ' , notification_type = None )
12641266 contributor = contributor_obj .user
12651267 assert contributor in node .contributors
12661268 assert contributor .is_registered is False
12671269
12681270 def test_add_contributor_fullname (self , user , node ):
1269- with capture_notifications ():
1270- contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), full_name = 'Jane Doe' )
1271+ with capture_notifications (expect_none = True ):
1272+ contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), full_name = 'Jane Doe' , notification_type = None )
12711273 contributor = contributor_obj .user
12721274 assert contributor in node .contributors
12731275 assert contributor .is_registered is False
12741276
12751277 def test_add_contributor_fullname_email_already_exists (self , user , node ):
12761278 registered_user = UserFactory ()
12771279 with capture_notifications ():
1278- contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), full_name = 'F Mercury' , email = registered_user .username )
1280+ contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), full_name = 'F Mercury' , email = registered_user .username , notification_type = None )
12791281 contributor = contributor_obj .user
12801282 assert contributor in node .contributors
12811283 assert contributor .is_registered is True
@@ -1284,7 +1286,7 @@ def test_add_contributor_fullname_email_exists_as_secondary(self, user, node):
12841286 registered_user = UserFactory ()
12851287 secondary_email = '[email protected] ' 12861288 Email .objects .create (address = secondary_email , user = registered_user )
1287- with capture_notifications ():
1289+ with capture_notifications (expect_none = True ):
12881290 contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), full_name = 'F Mercury' , email = secondary_email )
12891291 contributor = contributor_obj .user
12901292 assert contributor == registered_user
@@ -1295,7 +1297,7 @@ def test_add_contributor_unregistered(self, user, node):
12951297 unregistered_user = UnregUserFactory ()
12961298 unregistered_user .save ()
12971299 with capture_notifications ():
1298- contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), full_name = unregistered_user .fullname , email = unregistered_user .email )
1300+ contributor_obj = node .add_contributor_registered_or_not (auth = Auth (user ), full_name = unregistered_user .fullname , email = unregistered_user .email , notification_type = None )
12991301 contributor = contributor_obj .user
13001302 assert contributor == unregistered_user
13011303 assert contributor in node .contributors
@@ -1345,8 +1347,7 @@ def test_add_contributors_sends_contributor_added_signal(self, node, auth):
13451347 'permissions' : permissions .WRITE
13461348 }]
13471349 with capture_signals () as mock_signals :
1348- with capture_notifications ():
1349- node .add_contributors (contributors = contributors , auth = auth )
1350+ node .add_contributors (contributors = contributors , auth = auth )
13501351 node .save ()
13511352 assert node .is_contributor (user )
13521353 assert mock_signals .signals_sent () == {contributor_added }
@@ -2612,7 +2613,8 @@ def test_contributor_set_visibility_validation(self, node, user, auth):
26122613 [
26132614 {'user' : reg_user1 , 'permissions' : ADMIN , 'visible' : True },
26142615 {'user' : reg_user2 , 'permissions' : ADMIN , 'visible' : False },
2615- ]
2616+ ],
2617+ notification_type = None
26162618 )
26172619 with pytest .raises (ValueError ) as e :
26182620 node .set_visible (user = reg_user1 , visible = False , auth = None )
@@ -3364,7 +3366,8 @@ def test_move_contributor(self, user, node, auth):
33643366 {'user' : user1 , 'permissions' : WRITE , 'visible' : True },
33653367 {'user' : user2 , 'permissions' : WRITE , 'visible' : True }
33663368 ],
3367- auth = auth
3369+ auth = auth ,
3370+ notification_type = None
33683371 )
33693372
33703373 user_contrib_id = node .contributor_set .get (user = user ).id
0 commit comments