|
26 | 26 | update_special_exams_and_publish,
|
27 | 27 | rerun_course,
|
28 | 28 | _convert_to_standard_url,
|
29 |
| - _check_broken_links |
| 29 | + _check_broken_links, |
| 30 | + _is_studio_url |
30 | 31 | )
|
31 | 32 | from cms.djangoapps.contentstore.tests.test_libraries import LibraryTestCase
|
32 | 33 | from cms.djangoapps.contentstore.tests.utils import CourseTestCase
|
@@ -280,11 +281,17 @@ def test_hash_tags_stripped_from_url_lists(self):
|
280 | 281 | def test_urls_out_count_equals_urls_in_count_when_no_hashtags(self):
|
281 | 282 | raise NotImplementedError
|
282 | 283 |
|
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')) |
285 | 286 |
|
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')) |
288 | 295 |
|
289 | 296 | @pytest.mark.parametrize("url, course_key, post_substitution_url",
|
290 | 297 | ["/static/anything_goes_here?raw", "1", "2"])
|
|
0 commit comments