test(s3): Verify the construction of audio file urls with custom s3 domain

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2577>
environments/review-docs-fix-m-r2u168/deployments/18567
Georg Krause 2023-09-12 12:55:38 +02:00 zatwierdzone przez Marge
rodzic ab7fe55b51
commit 5eda0def09
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -131,3 +131,13 @@ def test_transcode_file(name, expected):
result = {k: round(v) for k, v in utils.get_audio_file_data(f).items()}
assert result == expected
def test_custom_s3_domain(factories, settings):
"""See #2220"""
settings.DEFAULT_FILE_STORAGE = "funkwhale_api.common.storage.ASCIIS3Boto3Storage"
settings.AWS_S3_CUSTOM_DOMAIN = "my.custom.domain.tld"
f = factories["music.Upload"].build(audio_file__filename="test.mp3")
print(f.audio_file.url)
assert f.audio_file.url.startswith("https://")