This repository has been archived on 2023-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
takahe/tests/api/test_statuses.py

18 lines
504 B
Python
Raw Normal View History

2022-12-12 08:54:51 +01:00
import pytest
@pytest.mark.django_db
def test_post_status(api_token, identity, client):
response = client.post(
"/api/v1/statuses",
HTTP_AUTHORIZATION=f"Bearer {api_token.token}",
HTTP_ACCEPT="application/json",
content_type="application/json",
data={
"status": "Hello, world!",
"visibility": "unlisted",
},
).json()
assert response["content"] == "<p>Hello, world!</p>"
assert response["visibility"] == "unlisted"