felicity-lims/felicity/tests/utils/user.py

71 lines
1.2 KiB
Python
Raw Normal View History

2022-11-20 21:20:41 +08:00
add_user_mutation = """
mutation AddUser(
$firstName: String!,
$lastName: String!,
$email: String!,
$openReg: Boolean
){
createUser(
firstName: $firstName,
lastName: $lastName,
email: $email,
openReg: $openReg,
) {
... on UserType {
uid
firstName
lastName
}
... on OperationError {
error
}
}
}
"""
add_auth_mutation = """
mutation AddUserAuth(
2023-04-08 17:16:11 +08:00
$userUid: FelicityID!,
2022-11-20 21:20:41 +08:00
$userName: String!,
$password: String!,
$passwordc: String!
){
createUserAuth(
userUid: $userUid,
userName: $userName,
password: $password,
passwordc: $passwordc,
) {
... on UserType {
uid
auth {
userName
}
}
... on OperationError {
error
}
}
}
"""
fetch_users = """
query {
userAll {
items {
auth {
userName
}
}
}
}
"""
def make_username(val: str) -> str:
return val.lower()
def make_password(val: str):
2023-03-19 23:21:32 +08:00
return f"!{make_username(val).capitalize()}#100"