@@ -1936,7 +1936,8 @@ def test_bulk_update_embargo_logged_in_contrib(
1936
1936
assert registration_one .is_pending_embargo_termination is False
1937
1937
assert registration_two .is_pending_embargo_termination is False
1938
1938
1939
- res = app .put_json_api (url , public_payload , auth = user .auth , bulk = True )
1939
+ with capture_notifications ():
1940
+ res = app .put_json_api (url , public_payload , auth = user .auth , bulk = True )
1940
1941
assert res .status_code == 200
1941
1942
assert ({registration_one ._id , registration_two ._id } == {
1942
1943
res .json ['data' ][0 ]['id' ], res .json ['data' ][1 ]['id' ]})
@@ -2025,7 +2026,8 @@ def update_contributor_attribute_request(self, auth_user, contributor, permissio
2025
2026
return self .app .patch_json_api (url , payload , auth = auth_user .auth , expect_errors = expect_errors )
2026
2027
2027
2028
def test_add_contributor (self ):
2028
- res = self .add_contributor_request (auth_user = self .user , contributor = self .contributor )
2029
+ with capture_notifications ():
2030
+ res = self .add_contributor_request (auth_user = self .user , contributor = self .contributor )
2029
2031
assert res .status_code == 201
2030
2032
assert res .json ['data' ]['embeds' ]['users' ]['data' ]['id' ] == self .contributor ._id
2031
2033
assert self .contributor .groups .filter (name__icontains = f'{ self .public_registration .id } _write' ).exists ()
@@ -2051,7 +2053,8 @@ def test_add_contributor(self):
2051
2053
assert self .contributor .groups .filter (name__icontains = f'{ self .public_registration .id } _read' ).exists () is False
2052
2054
2053
2055
def test_remove_contributor (self ):
2054
- self .add_contributor_request (self .user , self .contributor )
2056
+ with capture_notifications ():
2057
+ self .add_contributor_request (self .user , self .contributor )
2055
2058
res = self .remove_contributor_request (self .user , self .contributor )
2056
2059
assert res .status_code == 204
2057
2060
assert self .contributor .groups .exists () is False
@@ -2063,11 +2066,12 @@ def test_remove_contributor(self):
2063
2066
2064
2067
def test_contributor_can_edit_title_if_has_permission (self ):
2065
2068
TITLE = 'New Title'
2066
- self .add_contributor_request (
2067
- auth_user = self .user ,
2068
- contributor = self .contributor ,
2069
- permission = 'read'
2070
- )
2069
+ with capture_notifications ():
2070
+ self .add_contributor_request (
2071
+ auth_user = self .user ,
2072
+ contributor = self .contributor ,
2073
+ permission = 'read'
2074
+ )
2071
2075
res = self .update_registration_attribute_request (
2072
2076
auth_user = self .contributor ,
2073
2077
expect_errors = True ,
@@ -2091,17 +2095,17 @@ def test_contributor_cannot_edit_contributors(self):
2091
2095
for permission in ['read' , 'write' ]:
2092
2096
contributor_to_add = AuthUserFactory ()
2093
2097
contributor_to_remove = AuthUserFactory ()
2094
- self .add_contributor_request (
2095
- auth_user = self .user ,
2096
- contributor = self .contributor ,
2097
- permission = permission
2098
- )
2099
- self .add_contributor_request (
2100
- auth_user = self .user ,
2101
- contributor = contributor_to_remove ,
2102
- permission = permission
2103
- )
2104
2098
with capture_notifications ():
2099
+ self .add_contributor_request (
2100
+ auth_user = self .user ,
2101
+ contributor = self .contributor ,
2102
+ permission = permission
2103
+ )
2104
+ self .add_contributor_request (
2105
+ auth_user = self .user ,
2106
+ contributor = contributor_to_remove ,
2107
+ permission = permission
2108
+ )
2105
2109
res = self .add_contributor_request (
2106
2110
auth_user = self .contributor ,
2107
2111
contributor = contributor_to_add ,
@@ -2120,11 +2124,12 @@ def test_contributor_cannot_edit_contributors(self):
2120
2124
self .remove_contributor_request (self .user , contributor_to_remove )
2121
2125
2122
2126
def test_only_admin_can_update_permissions_and_bibliographic_status (self ):
2123
- self .add_contributor_request (
2124
- auth_user = self .user ,
2125
- contributor = self .contributor ,
2126
- permission = 'read'
2127
- )
2127
+ with capture_notifications ():
2128
+ self .add_contributor_request (
2129
+ auth_user = self .user ,
2130
+ contributor = self .contributor ,
2131
+ permission = 'read'
2132
+ )
2128
2133
res = self .update_contributor_attribute_request (
2129
2134
self .user ,
2130
2135
self .contributor ,
0 commit comments