예제 #1
0
def login(username, password, activation_token=None, expecting=200):
    payload = {"username": username, "password": password}
    if activation_token:
        payload['activation_token'] = activation_token

    r = client.put('/user/login', json=payload, headers=Headers.set())
    assert r.status_code == expecting
    if r.status_code == 200:
        Headers.update(authorization='Bearer %s' % r.json)
    return
예제 #2
0
def test_without_login_get_user_current(standard, prime):
    r = client.get('api/user', headers=Headers.set())
    assert r.status_code == 400
    return