def create_permission(permission, user_id, auth_token): if settings.LOCAL: return PermissionMocks.get_successful_permission_creation_response() else: return MedexRequest.post( auth_token, '%s/users/%s/permissions' % (settings.API_URL, user_id), permission)
def validate_session(auth_token): if settings.LOCAL: return SessionMocks.get_successful_validate_session_response() else: return MedexRequest.post(auth_token, '%s/auth/validate_session' % settings.API_URL)
def create_user(user_object, auth_token): if settings.LOCAL: return UserMocks.get_successful_user_creation_response() else: return MedexRequest.post(auth_token, '%s/users' % settings.API_URL, user_object)
def post_new_examination(examination_object, auth_token): if settings.LOCAL: return ExaminationMocks.get_successful_case_creation_response() else: return MedexRequest.post(auth_token, '%s/examinations' % settings.API_URL, json.dumps(examination_object))