Exemple #1
0
def test_update_status_user():
    new_status = 1
    user_id = "3"
    user_manager = Users()
    user_data = user_manager.get_user_details(user_id)
    old_status = user_data['status']

    ok = user_manager.update_user_status(user_id, new_status)
    assert ok

    user_new_data = user_manager.get_user_details(user_id)
    assert str(user_new_data['status']) == str(new_status)

    ok = user_manager.update_user_status(user_id, old_status)
    assert ok
Exemple #2
0
def update_status_user(id_user):
    status = request.args.get('status')
    user_endpoint = Users()
    ok = user_endpoint.update_user_status(id_user, status)
    return jsonify({"status": ok})