示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
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))