19 lines
485 B
Python
19 lines
485 B
Python
TEST_NAME = "users:login success"
|
|
|
|
|
|
def run(context) -> None:
|
|
payload = {
|
|
context.K_USERNAME: context.teacher_username,
|
|
context.K_PASSWORD: context.teacher_password,
|
|
}
|
|
status, body, _ = context.send_request(
|
|
"POST",
|
|
"/api/users/login",
|
|
body=payload,
|
|
)
|
|
context.expect(status == 200, f"expected 200, got {status}")
|
|
context.expect(
|
|
body == context.MESSAGE_LOGIN_OK,
|
|
f"unexpected login body: {body!r}",
|
|
)
|