|
21 | 21 | from osf.utils.permissions import ADMIN, WRITE, READ
|
22 | 22 | from website.project.signals import contributor_removed
|
23 | 23 | from api_tests.utils import disconnected_from_listeners
|
| 24 | +from api_tests.share._utils import mock_update_share |
24 | 25 | from website.views import find_bookmark_collection
|
25 | 26 |
|
26 | 27 |
|
@@ -4340,6 +4341,18 @@ def test_with_permissions(self, app, collection_with_three_collection_submission
|
4340 | 4341 | assert len(res.json['data']) == 0
|
4341 | 4342 | assert res.status_code == 200
|
4342 | 4343 |
|
| 4344 | + def test_update_share_called(self, app, collection_with_zero_collection_submission, user_one, project_four, url, payload, subject_one): |
| 4345 | + collection_with_zero_collection_submission.is_public = True |
| 4346 | + collection_with_zero_collection_submission.save() |
| 4347 | + |
| 4348 | + with mock_update_share() as _shmock: |
| 4349 | + res = app.post_json_api( |
| 4350 | + url.format(collection_with_zero_collection_submission._id), |
| 4351 | + payload(guid=project_four._id, subjects=[[subject_one._id]]), |
| 4352 | + auth=user_one.auth) |
| 4353 | + assert res.status_code == 201 |
| 4354 | + _shmock.assert_called() |
| 4355 | + |
4343 | 4356 | def test_filters(self, app, collection_with_one_collection_submission, collection_with_three_collection_submission, project_two, project_four, user_one, subject_one, url, payload):
|
4344 | 4357 | res = app.get(f'{url.format(collection_with_three_collection_submission._id)}?filter[id]={project_two._id}', auth=user_one.auth)
|
4345 | 4358 | assert res.status_code == 200
|
|
0 commit comments