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") is None def test_register_and_remove_user(app): with app.app_context(): user = User(app) assert user.register("neodarz") is None assert user.remove("neodarz") is None