Skip to content

Commit

Permalink
fix: feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jignaciopm committed Nov 7, 2024
1 parent c7158ab commit d64943b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions eox_core/api/v1/tests/integration/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1597,9 +1597,9 @@ def setUp(self) -> None:
{"detailed": True, "grading_policy": False},
{"detailed": True, "grading_policy": True},
)
def test_read_valid_params_successfully(self, extra_params: dict):
def test_get_grades_for_user_successfully(self, extra_params: dict):
"""
Get grades info from a user enrolled on a course.
Get Grade info about the user who belongs to tenant where the course is hosted
Open edX definitions tested:
- `get_edxapp_user`
Expand Down Expand Up @@ -1636,7 +1636,7 @@ def test_read_valid_params_successfully(self, extra_params: dict):
else:
self.assertNotIn("grading_policy", response_content)

def test_invalid_user_grade_for_another_site(self):
def test_get_grade_for_user_not_found(self):
"""
Test get grade info for a user and course from another site.
Expand All @@ -1655,16 +1655,17 @@ def test_invalid_user_grade_for_another_site(self):

response = self.get_grade_info(self.tenant_y, params)
response_data = response.json()

self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertIn("detail", response_data)
self.assertEqual(
response_data["detail"],
f"No user found by {{'username': '{params['username']}'}} on site {self.tenant_y['domain']}.",
)

def test_invalid_enrollment_with_existing_course(self):
def test_get_grade_for_enrollment_not_found(self):
"""
Test grade info for a invalid enrollment with existing course.
Test grade info for a enrollment not found.
Open edX definitions tested:
- `get_enrollment`
Expand All @@ -1675,16 +1676,17 @@ def test_invalid_enrollment_with_existing_course(self):
"""
response = self.get_grade_info(self.tenant_x, self.params)
response_data = response.json()

self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertEqual(
response_data, [
f"No enrollment found for user:`{self.user['username']}`"
],
)

def test_invalid_enrollment_without_course(self):
def test_get_grade_for_course_not_found(self):
"""
Test grade info for a invalid enrollment without course.
Test grade info for a course not found.
Open edX definitions tested:
- `get_enrollment`
Expand All @@ -1701,6 +1703,7 @@ def test_invalid_enrollment_without_course(self):
}
)
response_data = response.json()

self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertEqual(
response_data, [
Expand Down

0 comments on commit d64943b

Please sign in to comment.