Skip to content

Commit 637ff20

Browse files
committed
optimizer studio url tests
1 parent 85c14da commit 637ff20

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

cms/djangoapps/contentstore/tests/test_tasks.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
update_special_exams_and_publish,
2727
rerun_course,
2828
_convert_to_standard_url,
29-
_check_broken_links
29+
_check_broken_links,
30+
_is_studio_url
3031
)
3132
from cms.djangoapps.contentstore.tests.test_libraries import LibraryTestCase
3233
from cms.djangoapps.contentstore.tests.utils import CourseTestCase
@@ -280,11 +281,17 @@ def test_hash_tags_stripped_from_url_lists(self):
280281
def test_urls_out_count_equals_urls_in_count_when_no_hashtags(self):
281282
raise NotImplementedError
282283

283-
def test_http_and_https_recognized_as_studio_url_schemes(self):
284-
raise NotImplementedError
284+
def test_http_with_studio_base_url_recognized_as_studio_url_scheme(self):
285+
self.assertTrue(_is_studio_url(f'http://{settings.CMS_BASE}/testurl'))
285286

286-
def test_file_not_recognized_as_studio_url_scheme(self):
287-
raise NotImplementedError
287+
def test_https_with_studio_base_url_recognized_as_studio_url_scheme(self):
288+
self.assertTrue(_is_studio_url(f'https://{settings.CMS_BASE}/testurl'))
289+
290+
def test_url_is_recognized_as_studio_url_scheme(self):
291+
self.assertTrue(_is_studio_url(f'/url'))
292+
293+
def test_url_not_recognized_as_studio_url_scheme(self):
294+
self.assertFalse(_is_studio_url(f'http://nonedxurl.test'))
288295

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

0 commit comments

Comments
 (0)