コード例 #1
0
ファイル: test_search.py プロジェクト: fusionapp/mantissa
    def _renderAggregateSearch(self, charset, term):
        """
        Set up a store, and render an aggregate search, with charset
        C{charset} and search term {term}

        @return: deferred firing with string render result
        """
        s = Store()

        installOn(TrivialSearchProvider(store=s), s)

        agg = search.SearchAggregator(store=s)
        installOn(agg, s)

        f = search.AggregateSearchResults(agg)
        f.docFactory = getLoader(f.fragmentName)

        page = FragmentWrapper(f)

        req = AccumulatingFakeRequest()
        req.args = dict(_charset_=[charset], term=[term])

        result = renderLivePage(page, reqFactory=lambda: req)
        return result
コード例 #2
0
    def _renderAggregateSearch(self, charset, term):
        """
        Set up a store, and render an aggregate search, with charset
        C{charset} and search term {term}

        @return: deferred firing with string render result
        """
        s = Store()

        installOn(TrivialSearchProvider(store=s), s)

        agg = search.SearchAggregator(store=s)
        installOn(agg, s)

        f = search.AggregateSearchResults(agg)
        f.docFactory = getLoader(f.fragmentName)

        page = FragmentWrapper(f)

        req = AccumulatingFakeRequest()
        req.args = dict(_charset_=[charset], term=[term])

        result = renderLivePage(page, reqFactory=lambda: req)
        return result
コード例 #3
0
 def __init__(self, *a, **k):
     AccumulatingFakeRequest.__init__(self, *a, **k)
     self.args = {'title': [''], 'body': [''], 'url': ['']}
コード例 #4
0
 def __init__(self, *a, **k):
     AccumulatingFakeRequest.__init__(self, *a, **k)
     self.args = {'title': [''], 'body': [''], 'url': ['']}