def test_one_result_page(self): url = '/search.php?keywords=welcome' self.get(url) self.assert_successish() assert 'Search found 1 match' in self.response.body # remove highlighting response_text = utils.naive_strip_html(self.response.body) assert 'Welcome to phpBB' in response_text # it is in a title attribute assert 'Click to jump to page' not in self.response.body
def test_excessive_positive_offset(self): url = '/search.php?keywords=fancy&start=1000' self.get(url) self.assert_successish() assert 'Search found' in self.response.body # remove highlighting response_text = utils.naive_strip_html(self.response.body) assert 'Fancy post' in response_text assert 'Click to jump to page' in self.response.body # check active page current_page = self.find_current_page() assert current_page == 3
def test_search(self): url = '/index.php' self.get(url) self.assert_successish() form = self.response.form(id='search') elements = form.elements.mutable elements.set_value('keywords', 'welcome') self.post(form.computed_action, body=elements.params.list) self.assert_successish() assert 'Search found 1 match' in self.response.body # remove highlighting response_text = utils.naive_strip_html(self.response.body) assert 'Welcome to phpBB' in response_text