More refactoring
This commit is contained in:
@@ -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},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user