Skip to content

Commit

Permalink
test: add test file to check API authorizations
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperhodge committed Jan 14, 2025
1 parent 60947ce commit 4a2c148
Showing 1 changed file with 22 additions and 0 deletions.
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'}
)

0 comments on commit 4a2c148

Please sign in to comment.