-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test file to check API authorizations
- Loading branch information
1 parent
60947ce
commit 4a2c148
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
cms/djangoapps/contentstore/rest_api/v0/tests/test_course_optimizer.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from cms.djangoapps.contentstore.tests.test_utils import AuthorizeStaffTestCase | ||
from rest_framework import status | ||
from django.test import TestCase | ||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase | ||
from django.urls import reverse | ||
|
||
class TestCourseOptimizer(AuthorizeStaffTestCase, ModuleStoreTestCase, TestCase): | ||
''' | ||
Tests for CourseOptimizer | ||
''' | ||
def test_inherited(self): | ||
# This method ensures that pytest recognizes this class as containing tests | ||
pass | ||
|
||
def make_request(self, course_id=None, data=None): | ||
return self.client.get(self.get_url(course_id), data) | ||
|
||
def get_url(self, course_key): | ||
return reverse( | ||
'cms.djangoapps.contentstore:v0:link_check_status', | ||
kwargs={'course_id': 'course-v1:someOrg+someCourse+someRun'} | ||
) |