Exemplo n.º 1
0
def newuser():
    with api.test_client("*****@*****.**") as c:
        resp = c.user.delete()
        assert resp.code == 200 or resp.code == 403
    with api.test_client() as c:
        resp = c.user.post({
            "email": "*****@*****.**",
            "password": "******"
        })
        assert resp.code == 200
        yield resp.rv
    with api.test_client("*****@*****.**") as c:
        resp = c.user.delete()
        assert resp.code == 200
Exemplo n.º 2
0
def newuser():
    with api.test_client("*****@*****.**") as c:
        resp = c.user.delete()
        assert resp.code == 200 or resp.code == 403
    with api.test_client() as c:
        resp = c.user.post({
            "email": "*****@*****.**",
            "password": "******",
            "nickname": "tester",
            "photo": "http://pic.todos.com/photo/tester.png"
        })
        assert resp.code == 200
        yield resp.rv
    with api.test_client("*****@*****.**") as c:
        resp = c.user.delete()
        assert resp.code == 200
Exemplo n.º 3
0
def test_get(res):
    with api.test_client() as c:
        assert c.user.get().code == 403
    resp = res.user.get()
    assert resp.code == 200
    assert resp.rv["nickname"] == "tester"
    assert resp.rv["photo"] == "http://pic.todos.com/photo/tester.png"
    assert "pwdhash" not in resp.rv
Exemplo n.º 4
0
def res(newuser):
    with api.test_client("*****@*****.**") as c:
        yield c