@@ -307,19 +307,21 @@ def test_study_api_list_owners_permissions(api_client, study_scenario, study_fac
307
307
308
308
309
309
@pytest .mark .django_db
310
- def test_study_api_set_tasks_on_study_with_responses_permissions (
311
- api_client , private_study_with_responses
310
+ @pytest .mark .parametrize ('method,path' , [['post' , 'set-tasks' ], ['delete' , 'delete-tasks' ]])
311
+ def test_study_api_modify_tasks_on_study_with_responses_permissions (
312
+ api_client , private_study_with_responses , method , path
312
313
):
313
314
study = private_study_with_responses [0 ]
314
315
api_client .force_login (study .creator )
315
- r = api_client .post ( f'/api/v2/studies/{ study .pk } /set-tasks /' )
316
+ r = api_client .generic ( method , f'/api/v2/studies/{ study .pk } /{ path } /' )
316
317
assert r .status_code == 409
317
318
318
319
319
320
@pytest .mark .django_db
320
- def test_study_api_set_tasks_on_someone_elses_study_permissions (
321
- api_client , user_factory , public_study
321
+ @pytest .mark .parametrize ('method,path' , [['post' , 'set-tasks' ], ['delete' , 'delete-tasks' ]])
322
+ def test_study_api_modify_tasks_on_someone_elses_study_permissions (
323
+ api_client , user_factory , public_study , method , path
322
324
):
323
325
api_client .force_login (user_factory ())
324
- r = api_client .post ( f'/api/v2/studies/{ public_study .pk } /set-tasks /' )
326
+ r = api_client .generic ( method , f'/api/v2/studies/{ public_study .pk } /{ path } /' )
325
327
assert r .status_code == 403
0 commit comments