From 35a45f1c55fba69d690929c9420df565e7c5efcc Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 12 Dec 2022 00:54:51 -0700 Subject: A few more fixes and a bad test --- tests/api/test_statuses.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/api/test_statuses.py (limited to 'tests/api') diff --git a/tests/api/test_statuses.py b/tests/api/test_statuses.py new file mode 100644 index 0000000..1b00642 --- /dev/null +++ b/tests/api/test_statuses.py @@ -0,0 +1,17 @@ +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"] == "
Hello, world!
" + assert response["visibility"] == "unlisted" -- cgit v1.2.3