generated from john/python-template
This commit is contained in:
@@ -2,16 +2,6 @@ from transcription.ui.components.media_urls import public_media_path_label
|
||||
from transcription.ui.components.media_urls import resolve_media_url
|
||||
|
||||
|
||||
def test_resolve_media_url_maps_managed_absolute_path_to_upload_route(tmp_path):
|
||||
upload_dir = tmp_path / "uploads"
|
||||
canonical_path = upload_dir / "documents" / "abc" / "page.jpg"
|
||||
canonical_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
canonical_path.write_bytes(b"x")
|
||||
|
||||
resolved = resolve_media_url("documents/abc/page.jpg", upload_dir=upload_dir, base_url="http://localhost:8000")
|
||||
assert resolved == "http://localhost:8000/uploads/documents/abc/page.jpg"
|
||||
|
||||
|
||||
def test_resolve_media_url_rejects_absolute_filesystem_path(tmp_path):
|
||||
upload_dir = tmp_path / "uploads"
|
||||
absolute_path = upload_dir / "documents" / "abc" / "page.jpg"
|
||||
|
||||
Reference in New Issue
Block a user