-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ class NelpCourseRunViewSet(CourseRunViewSet): | |
""" | ||
Nelp version(flavour) of CourseRun Api View. | ||
""" | ||
pass |
55 changes: 53 additions & 2 deletions
55
eox_nelp/edxapp_wrapper/test_backends/cms_api_views_m_v1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,61 @@ | ||
"""Backend test abstraction.""" | ||
from rest_framework.response import Response | ||
|
||
from eox_nelp.edxapp_wrapper.test_backends import DummyViewset | ||
|
||
|
||
def get_course_run_view(): | ||
"""Return test class. | ||
Returns: | ||
Mock class. | ||
TestCourseRunViewSet class. | ||
""" | ||
return DummyViewset | ||
return TestCourseRunViewSet | ||
|
||
|
||
class TestCourseRunViewSet(DummyViewset): | ||
"""Test version of course Run viewset""" | ||
|
||
def list(self, request, *args, **kwargs): # lint-amnesty, pylint: disable=unused-argument | ||
return Response(COURSE_RUN_TEST_RESPONSE) | ||
|
||
|
||
COURSE_RUN_TEST_RESPONSE = { | ||
"next": "http://testserver/eox-nelp/api/v1/course_runs/?page=2", | ||
"previous": None, | ||
"count": 2, | ||
"num_pages": 2, | ||
"current_page": 1, | ||
"start": 0, | ||
"results": [ | ||
{ | ||
"schedule": { | ||
"start": "2033-02-02T00:00:00Z", | ||
"end": None, | ||
"enrollment_start": "2023-01-30T00:00:00Z", | ||
"enrollment_end": None, | ||
}, | ||
"pacing_type": "instructor_paced", | ||
"team": [{"user": "vader", "role": "instructor"}, {"user": "vader", "role": "staff"}], | ||
"id": "course-v1:edX+cd101+2023-t2", | ||
"title": "PROCEDURAL SEDATION AND ANALGESIA COURSE", | ||
"images": { | ||
"card_image": "http://testserver/asset-v1:edX+cd101+2023-t2+type@asset+block@images_course_image.jpg" | ||
}, | ||
}, | ||
{ | ||
"schedule": { | ||
"start": "2022-10-19T00:00:00Z", | ||
"end": "2022-10-31T00:00:00Z", | ||
"enrollment_start": "2022-10-01T00:00:00Z", | ||
"enrollment_end": "2022-10-17T00:00:00Z", | ||
}, | ||
"pacing_type": "instructor_paced", | ||
"team": [{"user": "vader", "role": "instructor"}, {"user": "vader", "role": "staff"}], | ||
"id": "course-v1:edX+completion+2023", | ||
"title": "Course test h", | ||
"images": { | ||
"card_image": "http://testserver/asset-v1:edX+completion+2023+type@[email protected]" | ||
}, | ||
}, | ||
], | ||
} |