Skip to content

Commit

Permalink
chore: use demo_course_id variable name instead course_id
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Sep 27, 2024
1 parent 8914e37 commit a7bae95
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions eox_core/api/v1/tests/integration/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ class TestEnrollmentAPIIntegration(BaseAPIIntegrationTest, UsersAPIRequestMixin,
def setUp(self) -> None:
"""Set up the test suite"""
super().setUp()
self.course_id = settings["COURSE_ID"]
self.demo_course_id = settings["DEMO_COURSE_ID"]
self.mode = "audit"
self.user = next(FAKE_USER_DATA)
self.create_user(self.tenant_x, self.user)
Expand Down Expand Up @@ -468,7 +468,7 @@ def test_create_enrollment_success(self, param: str, force_value: bool) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
"force": force_value,
}
Expand Down Expand Up @@ -506,7 +506,7 @@ def test_create_enrollment_missing_required_fields(self, param: str, error: list
enrollment_data = {
"username": self.user["username"],
"mode": self.mode,
"course_id": self.course_id,
"course_id": self.demo_course_id,
}
enrollment_data_copy = deepcopy(enrollment_data)
enrollment_data.pop(param)
Expand Down Expand Up @@ -538,7 +538,7 @@ def test_create_valid_course_mode_invalid_user(self, param: str, value: str) ->
"""
enrollment_data = {
param: value,
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
}

Expand Down Expand Up @@ -568,7 +568,7 @@ def test_create_valid_course_mode_invalid_user_for_tenant(self, param: str) -> N
self.create_user(self.tenant_y, user_data)
enrollment_data = {
param: user_data[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
}

Expand Down Expand Up @@ -627,7 +627,7 @@ def test_create_valid_user_mode_invalid_course_for_tenant(self, param: str) -> N
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
}

Expand All @@ -636,7 +636,7 @@ def test_create_valid_user_mode_invalid_course_for_tenant(self, param: str) -> N
response_data = response.json()
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn("course_id", response_data)
self.assertEqual(response_data["course_id"], [f"Invalid course_id {self.course_id}"])
self.assertEqual(response_data["course_id"], [f"Invalid course_id {self.demo_course_id}"])
enrollment_response = self.get_enrollment(self.tenant_x, data=enrollment_data)
self.assertEqual(enrollment_response.status_code, status.HTTP_404_NOT_FOUND)

Expand All @@ -656,7 +656,7 @@ def test_create_valid_user_course_unavailable_mode(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": "masters",
}

Expand Down Expand Up @@ -688,7 +688,7 @@ def test_force_create_valid_user_course_unavailable_mode(self, param: str) -> No
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": "masters",
"force": True,
}
Expand Down Expand Up @@ -720,7 +720,7 @@ def test_get_enrollment_success(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
}
self.create_enrollment(self.tenant_x, enrollment_data)
Expand Down Expand Up @@ -750,7 +750,7 @@ def test_get_enrollment_does_not_exist(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
}

response = self.get_enrollment(self.tenant_x, data=enrollment_data)
Expand All @@ -773,7 +773,7 @@ def test_get_enrollment_not_found_in_tenant(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
}
self.create_enrollment(self.tenant_x, enrollment_data)
Expand Down Expand Up @@ -803,7 +803,7 @@ def test_delete_enrollment_success(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
}
self.create_enrollment(self.tenant_x, enrollment_data)
Expand All @@ -829,7 +829,7 @@ def test_delete_enrollment_does_not_exist(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
}

response = self.delete_enrollment(self.tenant_x, data=enrollment_data)
Expand All @@ -839,7 +839,7 @@ def test_delete_enrollment_does_not_exist(self, param: str) -> None:
self.assertIn("detail", response_data)
self.assertEqual(
response_data["detail"],
f"No enrollment found for user: `{self.user['username']}` on course_id `{self.course_id}`",
f"No enrollment found for user: `{self.user['username']}` on course_id `{self.demo_course_id}`",
)

@ddt.data("email", "username")
Expand All @@ -858,7 +858,7 @@ def test_delete_invalid_enrollment_for_tenant(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"mode": self.mode,
}
self.create_enrollment(self.tenant_x, enrollment_data)
Expand Down Expand Up @@ -890,7 +890,7 @@ def test_update_valid_enrollment_change_is_active_mode_field(self, param: str) -
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"is_active": False,
"mode": self.mode,
}
Expand Down Expand Up @@ -928,7 +928,7 @@ def test_update_valid_enrollment_update_unavailable_mode(self, param: str) -> No
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"is_active": True,
"mode": self.mode,
}
Expand Down Expand Up @@ -962,7 +962,7 @@ def test_update_enrollment_does_not_exist(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"is_active": False,
"mode": self.mode,
}
Expand Down Expand Up @@ -993,7 +993,7 @@ def test_update_valid_enrollment_using_force_flag(self, param: str) -> None:
"""
enrollment_data = {
param: self.user[param],
"course_id": self.course_id,
"course_id": self.demo_course_id,
"is_active": False,
"mode": self.mode,
"force": True,
Expand Down
2 changes: 1 addition & 1 deletion eox_core/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ def plugin_settings(settings): # pylint: disable=function-redefined
"API_TIMEOUT": 5,
"CLIENT_ID": "client_id",
"CLIENT_SECRET": "client_secret",
"COURSE_ID": os.environ.get("COURSE_ID", "course-v1:OpenedX+DemoX+DemoCourse")
"DEMO_COURSE_ID": os.environ.get("DEMO_COURSE_ID", "course-v1:OpenedX+DemoX+DemoCourse")
}

0 comments on commit a7bae95

Please sign in to comment.