test(media): cover upload-url acceptance for mp4/m4a audio
Some checks failed
CI / test (push) Failing after 1m33s
Some checks failed
CI / test (push) Failing after 1m33s
This commit is contained in:
@@ -166,6 +166,33 @@ async def test_chat_list_includes_notification_muted_flag(client, db_session):
|
|||||||
assert row["muted"] is True
|
assert row["muted"] is True
|
||||||
|
|
||||||
|
|
||||||
|
async def test_media_upload_url_accepts_mp4_voice_mime_types(client, db_session):
|
||||||
|
user = await _create_verified_user(
|
||||||
|
client,
|
||||||
|
db_session,
|
||||||
|
"media_mime_user@example.com",
|
||||||
|
"media_mime_user",
|
||||||
|
"strongpass123",
|
||||||
|
)
|
||||||
|
auth = {"Authorization": f"Bearer {user['access_token']}"}
|
||||||
|
|
||||||
|
mp4_response = await client.post(
|
||||||
|
"/api/v1/media/upload-url",
|
||||||
|
headers=auth,
|
||||||
|
json={"file_name": "voice.m4a", "file_type": "audio/mp4", "file_size": 2048},
|
||||||
|
)
|
||||||
|
assert mp4_response.status_code == 200
|
||||||
|
assert "upload_url" in mp4_response.json()
|
||||||
|
|
||||||
|
m4a_response = await client.post(
|
||||||
|
"/api/v1/media/upload-url",
|
||||||
|
headers=auth,
|
||||||
|
json={"file_name": "voice-alt.m4a", "file_type": "audio/x-m4a", "file_size": 2048},
|
||||||
|
)
|
||||||
|
assert m4a_response.status_code == 200
|
||||||
|
assert "upload_url" in m4a_response.json()
|
||||||
|
|
||||||
|
|
||||||
async def test_private_chat_respects_contacts_only_policy(client, db_session):
|
async def test_private_chat_respects_contacts_only_policy(client, db_session):
|
||||||
u1 = await _create_verified_user(client, db_session, "pm_u1@example.com", "pm_user_one", "strongpass123")
|
u1 = await _create_verified_user(client, db_session, "pm_u1@example.com", "pm_user_one", "strongpass123")
|
||||||
u2 = await _create_verified_user(client, db_session, "pm_u2@example.com", "pm_user_two", "strongpass123")
|
u2 = await _create_verified_user(client, db_session, "pm_u2@example.com", "pm_user_two", "strongpass123")
|
||||||
|
|||||||
Reference in New Issue
Block a user