Skip to content

Commit

Permalink
Merge branch 'master' into jci/issue#35836
Browse files Browse the repository at this point in the history
  • Loading branch information
jciasenza authored Dec 9, 2024
2 parents 5c85525 + eadf5e2 commit 79ac943
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/djangoapps/static_replace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from xmodule.contentstore.content import StaticContent

log = logging.getLogger(__name__)
XBLOCK_STATIC_RESOURCE_PREFIX = '/static/xblock'
XBLOCK_STATIC_RESOURCE_PREFIX = '/static/xblock/'


def _url_replace_regex(prefix):
Expand Down
10 changes: 10 additions & 0 deletions common/djangoapps/static_replace/test/test_static_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ def processor(__, prefix, quote, rest): # pylint: disable=redefined-outer-name
assert process_static_urls(STATIC_SOURCE, processor) == '"test/static/file.png"'


def test_process_url_no_match_starts_with_xblock():
def processor(original, prefix, quote, rest): # pylint: disable=unused-argument, redefined-outer-name
return quote + 'test' + prefix + rest + quote
assert process_static_urls(
'"/static/xblock-file.png"',
processor,
data_dir=DATA_DIRECTORY
) == '"test/static/xblock-file.png"'


@patch('django.http.HttpRequest', autospec=True)
def test_static_urls(mock_request):
mock_request.build_absolute_uri = lambda url: 'http://' + url
Expand Down

0 comments on commit 79ac943

Please sign in to comment.