Skip to content

Commit

Permalink
optimizer studio url tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzhou-bit committed Jan 17, 2025
1 parent 85c14da commit 637ff20
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions cms/djangoapps/contentstore/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
update_special_exams_and_publish,
rerun_course,
_convert_to_standard_url,
_check_broken_links
_check_broken_links,
_is_studio_url
)
from cms.djangoapps.contentstore.tests.test_libraries import LibraryTestCase
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
Expand Down Expand Up @@ -280,11 +281,17 @@ def test_hash_tags_stripped_from_url_lists(self):
def test_urls_out_count_equals_urls_in_count_when_no_hashtags(self):
raise NotImplementedError

def test_http_and_https_recognized_as_studio_url_schemes(self):
raise NotImplementedError
def test_http_with_studio_base_url_recognized_as_studio_url_scheme(self):
self.assertTrue(_is_studio_url(f'http://{settings.CMS_BASE}/testurl'))

def test_file_not_recognized_as_studio_url_scheme(self):
raise NotImplementedError
def test_https_with_studio_base_url_recognized_as_studio_url_scheme(self):
self.assertTrue(_is_studio_url(f'https://{settings.CMS_BASE}/testurl'))

def test_url_is_recognized_as_studio_url_scheme(self):
self.assertTrue(_is_studio_url(f'/url'))

def test_url_not_recognized_as_studio_url_scheme(self):
self.assertFalse(_is_studio_url(f'http://nonedxurl.test'))

@pytest.mark.parametrize("url, course_key, post_substitution_url",
["/static/anything_goes_here?raw", "1", "2"])
Expand Down

0 comments on commit 637ff20

Please sign in to comment.