def setup_basic_put_test(self, user, with_local_site, local_site_name, put_valid_data): application = self.create_oauth_application( user=user, with_local_site=with_local_site) access_token = self.create_oauth_token(user=user, application=application, scope='root:read') if put_valid_data: request_data = { 'add_scopes': 'user:read', 'remove_scopes': 'root:read' } else: request_data = { 'add_scopes': 'root:write', 'scopes': 'root:write' } return (get_oauth_token_item_url(access_token.pk, local_site_name), oauth_token_item_mimetype, request_data, access_token, [])
def setup_basic_put_test(self, user, with_local_site, local_site_name, put_valid_data): application = self.create_oauth_application( user=user, with_local_site=with_local_site) access_token = self.create_oauth_token(user=user, application=application, scope='root:read') if put_valid_data: request_data = { 'add_scopes': 'user:read', 'remove_scopes': 'root:read' } else: request_data = { 'add_scopes': 'root:write', 'scopes': 'root:write' } return (get_oauth_token_item_url(access_token.pk, local_site_name), oauth_token_item_mimetype, request_data, access_token, [])
def setup_basic_delete_test(self, user, with_local_site, local_site_name): application = self.create_oauth_application( user=user, with_local_site=with_local_site, ) access_token = self.create_oauth_token(application=application, user=user) return (get_oauth_token_item_url(access_token.pk, local_site_name), [access_token.pk])
def setup_basic_delete_test(self, user, with_local_site, local_site_name): application = self.create_oauth_application( user=user, with_local_site=with_local_site, ) access_token = self.create_oauth_token(application=application, user=user) return (get_oauth_token_item_url(access_token.pk, local_site_name), [access_token.pk])
def setup_basic_get_test(self, user, with_local_site, local_site_name): application = self.create_oauth_application( user=user, with_local_site=with_local_site, ) access_token = self.create_oauth_token(user=user, application=application, scope='root:read') return (get_oauth_token_item_url(access_token.pk, local_site_name), oauth_token_item_mimetype, access_token)
def setup_basic_get_test(self, user, with_local_site, local_site_name): application = self.create_oauth_application( user=user, with_local_site=with_local_site, ) access_token = self.create_oauth_token(user=user, application=application, scope='root:read') return (get_oauth_token_item_url(access_token.pk, local_site_name), oauth_token_item_mimetype, access_token)
def setup_http_not_allowed_item_test(self, user): return get_oauth_token_item_url(1)
def setup_http_not_allowed_item_test(self, user): return get_oauth_token_item_url(1)