当前位置: 首页>>代码示例>>Python>>正文


Python Website.get_indexer方法代码示例

本文整理汇总了Python中mkt.websites.models.Website.get_indexer方法的典型用法代码示例。如果您正苦于以下问题:Python Website.get_indexer方法的具体用法?Python Website.get_indexer怎么用?Python Website.get_indexer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mkt.websites.models.Website的用法示例。


在下文中一共展示了Website.get_indexer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: tearDown

# 需要导入模块: from mkt.websites.models import Website [as 别名]
# 或者: from mkt.websites.models.Website import get_indexer [as 别名]
    def tearDown(self):
        # Taken from MultiSearchView test.
        for w in Webapp.objects.all():
            w.delete()
        for w in Website.objects.all():
            w.delete()
        super(TestDailyGamesView, self).tearDown()

        Webapp.get_indexer().unindexer(_all=True)
        Website.get_indexer().unindexer(_all=True)
        self.refresh(('webapp', 'website'))
开发者ID:Jobava,项目名称:zamboni,代码行数:13,代码来源:test_views.py

示例2: tearDown

# 需要导入模块: from mkt.websites.models import Website [as 别名]
# 或者: from mkt.websites.models.Website import get_indexer [as 别名]
    def tearDown(self):
        for o in Webapp.objects.all():
            o.delete()
        for o in Website.objects.all():
            o.delete()
        for o in Extension.objects.all():
            o.delete()
        super(TestMultiSearchView, self).tearDown()

        # Make sure to delete and unindex *all* things. Normally we wouldn't
        # care about stray deleted content staying in the index, but they can
        # have an impact on relevancy scoring so we need to make sure. This
        # needs to happen after super() has been called since it'll process the
        # indexing tasks that should happen post_request, and we need to wait
        # for ES to have done everything before continuing.
        Webapp.get_indexer().unindexer(_all=True)
        Website.get_indexer().unindexer(_all=True)
        Extension.get_indexer().unindexer(_all=True)
        self.refresh(('webapp', 'website', 'extension'))
开发者ID:Witia1,项目名称:zamboni,代码行数:21,代码来源:test_views.py

示例3: test_q_num_requests

# 需要导入模块: from mkt.websites.models import Website [as 别名]
# 或者: from mkt.websites.models.Website import get_indexer [as 别名]
    def test_q_num_requests(self):
        es = Website.get_indexer().get_es()
        orig_search = es.search
        es.counter = 0

        def monkey_search(*args, **kwargs):
            es.counter += 1
            return orig_search(*args, **kwargs)

        es.search = monkey_search

        with self.assertNumQueries(0):
            res = self.anon.get(self.url, data={'q': 'something'})
        eq_(res.status_code, 200)
        eq_(res.json['meta']['total_count'], 1)
        eq_(len(res.json['objects']), 1)

        # Verify only one search call was made.
        eq_(es.counter, 1)

        es.search = orig_search
开发者ID:Fjoerfoks,项目名称:zamboni,代码行数:23,代码来源:test_views.py

示例4: tearDown

# 需要导入模块: from mkt.websites.models import Website [as 别名]
# 或者: from mkt.websites.models.Website import get_indexer [as 别名]
 def tearDown(self):
     Website.get_indexer().unindexer(_all=True)
     super(TestMultiSearchView, self).tearDown()
开发者ID:shahbaz17,项目名称:zamboni,代码行数:5,代码来源:test_views.py

示例5: tearDown

# 需要导入模块: from mkt.websites.models import Website [as 别名]
# 或者: from mkt.websites.models.Website import get_indexer [as 别名]
 def tearDown(self):
     Website.get_indexer().unindexer(_all=True)
     super(TestWebsiteESView, self).tearDown()
开发者ID:clouserw,项目名称:zamboni,代码行数:5,代码来源:test_views.py

示例6: setUp

# 需要导入模块: from mkt.websites.models import Website [as 别名]
# 或者: from mkt.websites.models.Website import get_indexer [as 别名]
 def setUp(self):
     self.indexer = Website.get_indexer()()
开发者ID:Jobava,项目名称:zamboni,代码行数:4,代码来源:test_indexers.py

示例7: tearDown

# 需要导入模块: from mkt.websites.models import Website [as 别名]
# 或者: from mkt.websites.models.Website import get_indexer [as 别名]
 def tearDown(self):
     Website.get_indexer().unindexer(_all=True)
     super(TestReviewerSearch, self).tearDown()
开发者ID:psvramaraju,项目名称:zamboni,代码行数:5,代码来源:test_views.py


注:本文中的mkt.websites.models.Website.get_indexer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。