diff --git a/backend/project/endpoints/courses/courses.py b/backend/project/endpoints/courses/courses.py index d4f12c45..a56541e7 100644 --- a/backend/project/endpoints/courses/courses.py +++ b/backend/project/endpoints/courses/courses.py @@ -44,12 +44,8 @@ def post(self, teacher_id=None): This function will create a new course if the body of the post contains a name and uid is an admin or teacher """ -<<<<<<< HEAD - -======= req = request.json req["teacher"] = teacher_id ->>>>>>> development return insert_into_model( Course, req, diff --git a/backend/tests/endpoints/conftest.py b/backend/tests/endpoints/conftest.py index cd1ffb27..dda6a312 100644 --- a/backend/tests/endpoints/conftest.py +++ b/backend/tests/endpoints/conftest.py @@ -193,7 +193,6 @@ def course_no_name(valid_teacher_entry): return {"name": "", "teacher": valid_teacher_entry.uid} @pytest.fixture -<<<<<<< HEAD def course_empty_name(): """A course with an empty name""" return {"name": "", "teacher": "Bart"} @@ -202,14 +201,12 @@ def course_empty_name(): def invalid_course(): """An invalid course for testing.""" return {"invalid": "error"} -======= def valid_course_entry(session, valid_course): """A valid course for testing that's already in the db""" course = Course(**valid_course) session.add(course) session.commit() return course ->>>>>>> development @pytest.fixture def valid_students_entries(session): diff --git a/backend/tests/endpoints/course/courses_test.py b/backend/tests/endpoints/course/courses_test.py index 15a49791..3b5853e5 100644 --- a/backend/tests/endpoints/course/courses_test.py +++ b/backend/tests/endpoints/course/courses_test.py @@ -3,7 +3,7 @@ class TestCourseEndpoint: """Class for testing the courses endpoint""" - def test_post_courses(self, client, valid_course): + def test_post_courses(self, client, valid_course,invalid_course): """ Test posting a course to the /courses endpoint """ @@ -18,7 +18,6 @@ def test_post_courses(self, client, valid_course): get_response = client.get(f"/courses/{data['data']['course_id']}", headers={"Authorization":"teacher2"}) assert get_response.status_code == 200 -<<<<<<< HEAD response = client.post( "/courses?uid=Bart", json=invalid_course ) # invalid course @@ -31,8 +30,6 @@ def test_post_no_name(self, client, course_empty_name): response = client.post("/courses?uid=Bart", json=course_empty_name) assert response.status_code == 400 -======= ->>>>>>> development def test_post_courses_course_id_students_and_admins( self, client, valid_course_entry, valid_students_entries):