diff --git a/backend/tests/endpoints/course/courses_test.py b/backend/tests/endpoints/course/courses_test.py index ca3599c5..b3145d68 100644 --- a/backend/tests/endpoints/course/courses_test.py +++ b/backend/tests/endpoints/course/courses_test.py @@ -115,7 +115,7 @@ def test_data_fields(self, data_field_type_test: tuple[str, Any, str, dict[str, ### QUERY PARAMETER ### # Test a query parameter, should return [] for wrong values query_parameter_tests = \ - query_parameter_tests("/courses", "get", "student", [f.name for f in fields(Course)]) + query_parameter_tests("/courses", "get", "teacher", [f.name for f in fields(Course)]) @mark.parametrize("query_parameter_test", query_parameter_tests, indirect=True) def test_query_parameters(self, query_parameter_test: tuple[str, Any, str, bool]): @@ -127,7 +127,7 @@ def test_query_parameters(self, query_parameter_test: tuple[str, Any, str, bool] ### COURSES ### def test_get_courses(self, client: FlaskClient, courses: list[Course]): """Test getting all courses""" - csrf = get_csrf_from_login(client, "student") + csrf = get_csrf_from_login(client, "teacher") response = client.get("/courses", headers = {"X-CSRF-TOKEN":csrf}) assert response.status_code == 200 data = [course["name"] for course in response.json["data"]] @@ -222,7 +222,6 @@ def test_post_courses(self, client: FlaskClient, teacher: User): } ) assert response.status_code == 201 - csrf = get_csrf_from_login(client, "student") response = client.get("/courses?name=test", headers = {"X-CSRF-TOKEN":csrf}) assert response.status_code == 200 data = response.json["data"][0]