Skip to content

Commit

Permalink
fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
JibrilExe committed Mar 14, 2024
1 parent d2a8ff6 commit cc89841
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
4 changes: 0 additions & 4 deletions backend/project/endpoints/courses/courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions backend/tests/endpoints/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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):
Expand Down
5 changes: 1 addition & 4 deletions backend/tests/endpoints/course/courses_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit cc89841

Please sign in to comment.