Skip to content

Commit

Permalink
test: add missing component_versions to the library assets path
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Oct 21, 2024
1 parent 0964a12 commit c143500
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def test_embed_view_versions_static_assets(self):
# show up.
html = self._embed_block(block_id, version='published')
# This is the pattern we're looking for:
# <img src="https://localhost:18010/library_assets/b5864c63-e1da-4d48-8c8a-cc718e2f9ad3/static/deer.jpg"/>
assert re.search(r'/library_assets/[0-9a-f-]*/static/deer.jpg', html)
# <img src="https://localhost:18010/library_assets/component_versions/b5864c63-e1da-4d48-8c8a-cc718e2f9ad3/static/deer.jpg"/>
assert re.search(r'/library_assets/component_versions/[0-9a-f-]*/static/deer.jpg', html)

# Now grab the draft version (4), which is going to once again not have
# the asset (because we deleted it).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def _lookup_asset_url(self, block: XBlock, asset_path: str) -> str | None:
then this method will be called with asset_path="test.png" and should
return a URL like:
http://studio.local.openedx.io:8001/library_assets/cd31871e-a342-4c3f-ba2f-a661bf630996/static/test.png
http://studio.local.openedx.io:8001/library_assets/component_versions/cd31871e-a342-4c3f-ba2f-a661bf630996/static/test.png
If the asset file is not recognized, return None
Expand Down

0 comments on commit c143500

Please sign in to comment.