Пример #1
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
Пример #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': ['']}