✨ Added delete-user route
This commit is contained in:
@@ -3,7 +3,7 @@ import pytest
|
||||
from classquiz.kahoot_importer.get import get
|
||||
|
||||
|
||||
@pytest.mark.order("last")
|
||||
@pytest.mark.order(-2)
|
||||
@pytest.mark.asyncio
|
||||
async def test_get():
|
||||
await get("1f95eb0b-fcf4-4db2-879b-5418ef75116b")
|
||||
|
||||
@@ -4,7 +4,7 @@ from classquiz.kahoot_importer.search import search
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.order("last")
|
||||
@pytest.mark.order(-2)
|
||||
async def test_search():
|
||||
res = await search(query="Python", limit=100)
|
||||
assert len(res.entities) == 100
|
||||
|
||||
@@ -359,3 +359,16 @@ class TestQuiz:
|
||||
ValueStorage.imported_quizzes.append(resp.json()["id"])
|
||||
resp = test_client.post("/api/v1/quiz/import/1f95eb0bdassdadasdas", cookies={"access_token": token})
|
||||
assert resp.text == '"quiz not found"'
|
||||
|
||||
|
||||
class TestDeleteUser:
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_user(self, test_client):
|
||||
resp = test_client.post(
|
||||
"/api/v1/users/token/cookie", data={"username": test_user_email, "password": test_user_password}
|
||||
)
|
||||
token = resp.cookies["access_token"]
|
||||
resp = test_client.delete(
|
||||
"/api/v1/users/me", cookies={"access_token": token}, json={"password": test_user_password}
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user