8
8
from unittest import mock , TestCase
9
9
from uuid import uuid4
10
10
11
+ import pytest as pytest
11
12
from django .conf import settings
12
13
from django .contrib .auth .models import User # lint-amnesty, pylint: disable=imported-auth-user
13
14
from django .test .utils import override_settings
17
18
from organizations .tests .factories import OrganizationFactory
18
19
from user_tasks .models import UserTaskArtifact , UserTaskStatus
19
20
20
- from cms .djangoapps .contentstore .tasks import export_olx , update_special_exams_and_publish , rerun_course
21
+ from cms .djangoapps .contentstore .tasks import (
22
+ export_olx ,
23
+ update_special_exams_and_publish ,
24
+ rerun_course ,
25
+ _convert_to_standard_url
26
+ )
21
27
from cms .djangoapps .contentstore .tests .test_libraries import LibraryTestCase
22
28
from cms .djangoapps .contentstore .tests .utils import CourseTestCase
23
29
from common .djangoapps .course_action_state .models import CourseRerunState
@@ -202,6 +208,8 @@ def test_register_exams_failure(self, _mock_register_exams_proctoring, _mock_reg
202
208
203
209
204
210
class CourseOptimizerTestCase (TestCase ):
211
+
212
+
205
213
def test_user_does_not_exist_raises_exception (self ):
206
214
raise NotImplementedError
207
215
@@ -220,8 +228,11 @@ def test_http_and_https_recognized_as_studio_url_schemes(self):
220
228
def test_file_not_recognized_as_studio_url_scheme (self ):
221
229
raise NotImplementedError
222
230
223
- def test_url_substitution_on_static_prefixes (self ):
224
- raise NotImplementedError
231
+ @pytest .mark .parametrize ("url, course_key, post_substitution_url" ,
232
+ ["/static/anything_goes_here?raw" , "1" , "2" ])
233
+ def test_url_substitution_on_static_prefixes (self , url , course_key , post_substitution_url ):
234
+ with_substitution = _convert_to_standard_url (url , course_key )
235
+ assert with_substitution == post_substitution_url
225
236
226
237
def test_url_substitution_on_forward_slash_prefixes (self ):
227
238
raise NotImplementedError
0 commit comments