def test_delete_user(self, testdir_class, test_utils):
     testdir_class.activate()
     username = test_utils.random_string(5)
     Users.create_user(username, '123456')
     errors = Users.delete_user(username)
     assert errors == []
     assert not Users.user_exists(username)
 def test_delete_user_not_exist(self, testdir_class):
     testdir_class.activate()
     username = '******'
     errors = Users.delete_user(username)
     assert errors == [f'Username {username} does not exist']
Beispiel #3
0
def users_delete():
    _verify_permissions(Permissions.SUPER_USER)
    username = request.json['username']
    errors = Users.delete_user(username)
    return jsonify({'errors': errors})