def test_delete_user(self): name = 'user_name' password = '******' level = 'normal' user = add_user(name, password, level) assert len(get_user()) == 1 user = get_user()[0] delete_user(user) assert len(get_user()) == 0
def delete(): request_data = request.json logger.debug('--request_data--' + str(request_data)) id = request_data.get('id') if not (id and ObjectId.is_valid(id)): abort(400) result = delete_user(ObjectId(id)) if result: return Response(status=204) else: return Response(status=202)
def delete(self, key): user = get_user(key=key)[0] delete_user(user)