MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / create_user

Method create_user

examples/fastapi/_tests.py:68–78  ·  view source on GitHub ↗
(self, async_client: AsyncClient)

Source from the content-addressed store, hash-verified

66
67class UserTester:
68 async def create_user(self, async_client: AsyncClient) -> Users:
69 response = await async_client.post("/users", json={"username": "admin"})
70 assert response.status_code == 200, response.text
71 data = response.json()
72 assert data["username"] == "admin"
73 assert "id" in data
74 user_id = data["id"]
75
76 user_obj = await Users.get(id=user_id)
77 assert user_obj.id == user_id
78 return user_obj
79
80 async def user_list(self, async_client: AsyncClient) -> tuple[datetime, Users, User_Pydantic]:
81 utc_now = datetime.now(UTC)

Callers 2

test_create_userMethod · 0.80
test_create_user_eastMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected