More refactoring

This commit is contained in:
lvrossem
2023-04-18 02:52:26 -06:00
parent d074074b03
commit 3968dfd4eb
10 changed files with 156 additions and 64 deletions

View File

@@ -16,10 +16,17 @@ password = "password"
avatar_index = 1
def get_headers(token=None):
if token:
return {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
else:
return {"Content-Type": "application/json"}
async def register_user():
response = client.post(
"/register",
headers={"Content-Type": "application/json"},
headers=get_headers(),
json={"username": username, "password": password, "avatar_index": avatar_index},
)