feat: конф нгинкс, тесты, ключ идмпт etc

This commit is contained in:
Enterxx2
2026-10-20 10:41:56 +03:00
parent aa971fbd27
commit b53e5d1077
63 changed files with 5013 additions and 153 deletions
+13 -3
View File
@@ -2,7 +2,7 @@
import httpx
import pytest
from helpers import assert_error, auth
from helpers import assert_error, auth, message_headers
PASSWORD = "Valid-password-123"
@@ -32,8 +32,16 @@ def test_malformed_json_on_create_chat_and_message(
assert_error(
api.post("/api/v1/chats", content=raw, headers=headers), 400, "invalid_request"
)
message_post_headers = {
**message_headers(alice),
"Content-Type": "application/json",
}
assert_error(
api.post(f"/api/v1/chats/{chat['id']}/messages", content=raw, headers=headers),
api.post(
f"/api/v1/chats/{chat['id']}/messages",
content=raw,
headers=message_post_headers,
),
400,
"invalid_request",
)
@@ -78,7 +86,9 @@ def test_invalid_message_payload(
alice = make_user("alice")
chat = make_chat(alice, [alice])
response = api.post(
f"/api/v1/chats/{chat['id']}/messages", json=body, headers=auth(alice)
f"/api/v1/chats/{chat['id']}/messages",
json=body,
headers=message_headers(alice),
)
assert_error(response, 400, "invalid_request")