本文整理汇总了Python中atramhasis.views.views.AtramhasisView.search_result方法的典型用法代码示例。如果您正苦于以下问题:Python AtramhasisView.search_result方法的具体用法?Python AtramhasisView.search_result怎么用?Python AtramhasisView.search_result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atramhasis.views.views.AtramhasisView
的用法示例。
在下文中一共展示了AtramhasisView.search_result方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_no_schema
# 需要导入模块: from atramhasis.views.views import AtramhasisView [as 别名]
# 或者: from atramhasis.views.views.AtramhasisView import search_result [as 别名]
def test_no_schema(self):
self.request.matchdict['scheme_id'] = 'GG'
self.request.params = MultiDict()
self.request.skos_registry = self.regis
atramhasisview = AtramhasisView(self.request)
info = atramhasisview.search_result()
self.assertEqual(info.status_int, 404)
示例2: test_no_querystring
# 需要导入模块: from atramhasis.views.views import AtramhasisView [as 别名]
# 或者: from atramhasis.views.views.AtramhasisView import search_result [as 别名]
def test_no_querystring(self):
self.request.matchdict['scheme_id'] = 'TREES'
self.request.params = MultiDict()
self.request.skos_registry = self.regis
atramhasisview = AtramhasisView(self.request)
info = atramhasisview.search_result()
self.assertIsNotNone(info['concepts'])
self.assertEqual(len(info['concepts']), 3)
示例3: test_find_by_concept
# 需要导入模块: from atramhasis.views.views import AtramhasisView [as 别名]
# 或者: from atramhasis.views.views.AtramhasisView import search_result [as 别名]
def test_find_by_concept(self):
self.request.matchdict['scheme_id'] = 'TREES'
self.request.params = MultiDict()
self.request.params.add('ctype', 'concept')
self.request.params.add('_LOCALE_', 'nl')
self.request.skos_registry = self.regis
atramhasisview = AtramhasisView(self.request)
info = atramhasisview.search_result()
self.assertIsNotNone(info['concepts'])
concept = info['concepts'][0]
self.assertIsNotNone(concept)
self.assertEqual(info['scheme_id'], 'TREES')
示例4: test_find_by_label
# 需要导入模块: from atramhasis.views.views import AtramhasisView [as 别名]
# 或者: from atramhasis.views.views.AtramhasisView import search_result [as 别名]
def test_find_by_label(self):
request = testing.DummyRequest()
request.matchdict['scheme_id'] = 'TREES'
request.params = MultiDict()
request.params.add('label', 'De Paardekastanje')
request.params.add('_LOCALE_', 'nl')
request.skos_registry = self.regis
atramhasisview = AtramhasisView(request)
info = atramhasisview.search_result()
self.assertIsNotNone(info['concepts'])
concept = info['concepts'][0]
self.assertIsNotNone(concept)
self.assertEqual(concept['label'], 'De Paardekastanje')
self.assertEqual(info['scheme_id'], 'TREES')