Loading tests/rest/test_permissions.py +17 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,15 @@ def teacher_credentials() -> str: }) @pytest.fixture def teacher_secret() -> str: return json.dumps({ "type": "secret", "identifier": "teacher1", "secret": "ultimate_teacher_secret" }) def test_project_detail_using_admin_cred(client): path = f'/courses/testcourse1' response = utils.make_request(client, path, 'get') Loading @@ -34,7 +43,6 @@ def test_project_detail_using_student_cred(client, student_credentials): path = f'/courses/testcourse1' response = utils.make_request( client, path, 'get', credentials=student_credentials) print(f"Response: {response.data}") assert response.status_code == 200 assert response.mimetype == 'application/json' Loading @@ -43,6 +51,13 @@ def test_project_detail_using_teacher_cred(client, teacher_credentials): path = f'/courses/testcourse1/projects' response = utils.make_request( client, path, 'get', credentials=teacher_credentials) print(f"Response: {response.data}") assert response.status_code == 200 assert response.mimetype == 'application/json' def test_project_detail_using_teacher_secret(client, teacher_secret): path = f'/courses/testcourse1' response = utils.make_request( client, path, 'get', credentials=teacher_secret) assert response.status_code == 200 assert response.mimetype == 'application/json' Loading
tests/rest/test_permissions.py +17 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,15 @@ def teacher_credentials() -> str: }) @pytest.fixture def teacher_secret() -> str: return json.dumps({ "type": "secret", "identifier": "teacher1", "secret": "ultimate_teacher_secret" }) def test_project_detail_using_admin_cred(client): path = f'/courses/testcourse1' response = utils.make_request(client, path, 'get') Loading @@ -34,7 +43,6 @@ def test_project_detail_using_student_cred(client, student_credentials): path = f'/courses/testcourse1' response = utils.make_request( client, path, 'get', credentials=student_credentials) print(f"Response: {response.data}") assert response.status_code == 200 assert response.mimetype == 'application/json' Loading @@ -43,6 +51,13 @@ def test_project_detail_using_teacher_cred(client, teacher_credentials): path = f'/courses/testcourse1/projects' response = utils.make_request( client, path, 'get', credentials=teacher_credentials) print(f"Response: {response.data}") assert response.status_code == 200 assert response.mimetype == 'application/json' def test_project_detail_using_teacher_secret(client, teacher_secret): path = f'/courses/testcourse1' response = utils.make_request( client, path, 'get', credentials=teacher_secret) assert response.status_code == 200 assert response.mimetype == 'application/json'