aboutsummaryrefslogtreecommitdiff
path: root/src/tests/test_user.py
blob: c6ddbd4d6466b5de12846b78baf8ad91af4f06f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pytest, re

from bson.json_util import dumps

from lb_app.app_db.user import User

def test_get_all_users(app):
    with app.app_context():
        user = User(app)
        assert re.search('username', dumps(user.all()))

def test_register_user(app):
    with app.app_context():
        user = User(app)
        assert user.register("neodarz")['code'] is 201

def test_register_and_remove_user(app):
    with app.app_context():
        user = User(app)
        assert user.register("neodarz")['code'] is 201
        assert user.remove("neodarz")['code'] is 200