def test_search_type(self): """Only return entries of especific type.""" request = TestRequest(form=dict(SearchableText='type:Document')) view = Search(self.portal, request) results = view.results() results = [x for x in results] self.assertTrue(len(results) == 2) for r in results: self.assertIn(r.Title(), ('doc1', 'doc2'))
def test_search_one_user(self): """Only return entries of one especific user.""" request = TestRequest(form=dict(SearchableText='user: ' + self.USER1_ID)) view = Search(self.portal, request) results = view.results() results = [x for x in results] # only three results created by the default user, plus the folder assert (len(results) == 3)