diff --git a/tests/api/test_statuses.py b/tests/api/test_statuses.py index f6ef0e7..412a788 100644 --- a/tests/api/test_statuses.py +++ b/tests/api/test_statuses.py @@ -56,6 +56,32 @@ def test_post_status(api_client, identity): assert response.status_code == 404 +@pytest.mark.django_db +def test_post_statusless(api_client, identity): + """ + Tests we can post with media but no status + """ + # Create media attachment + attachment = PostAttachment.objects.create( + mimetype="image/webp", + name=None, + state=PostAttachmentStates.fetched, + author=identity, + ) + # Post new one + response = api_client.post( + "/api/v1/statuses", + content_type="application/json", + data={ + "media_ids": [attachment.id], + }, + ) + assert 200 <= response.status_code < 300 + body = response.json() + assert body["content"] == "

" + assert body["media_attachments"][0]["description"] is None + + @pytest.mark.django_db def test_mention_format(api_client, identity, remote_identity): """