def test_highlighting_for_one_line_summary(self): search_results_instance = SearchResults(self.fixture) result_with_one_line_highlight = self._get_service_result_by_id( search_results_instance.search_results, '4-G4-0871-001') self.assertEqual( result_with_one_line_highlight['serviceSummary'], Markup("Fastly <em>CDN</em> (Content Delivery Network) speeds up" + " delivery of your website and its content to your"))
def test_highlighting_for_multiple_line_summary(self): search_results_instance = SearchResults(self.fixture) result_with_multi_line_highlight = self._get_service_result_by_id( search_results_instance.search_results, '4-G1-0340-001') self.assertEqual( result_with_multi_line_highlight['serviceSummary'], Markup(" Baycloud Systems or in a suitable Content Delivery" " Network (<em>CDN</em>) such as the Windows Azure" + " <em>CDN</em>. The <em>CDN</em> improves performance" + " by caching content at locations closest to visitors" + " to customer\u2019s websites. The Windows Azure" + " <em>CDN</em> is a managed service that is operated by" + " Microsoft and has a 99.99% monthly"))
def setUp(self): self.fixture = _get_fixture_data() self.search_results = SearchResults(self.fixture) self.request_args = MultiDict([('lot', 'saas'), ('q', 'email')])
def test_highlighting_only_happens_on_service_summaries(self): search_results_instance = SearchResults(self.fixture) result_with_service_name_highlight = self._get_service_result_by_id( search_results_instance.search_results, '5-G3-0279-010') self.assertEqual(result_with_service_name_highlight['serviceName'], "CDN VDMS")
def test_search_results_page_is_set(self): search_results_instance = SearchResults(self.multiple_pages_fixture) self.assertTrue(hasattr(search_results_instance, 'page')) assert_equal(search_results_instance.page, "20")
def test_search_results_page_is_not_set(self): search_results_instance = SearchResults(self.fixture) self.assertFalse(hasattr(search_results_instance, 'page'))
def test_search_results_total_is_set(self): search_results_instance = SearchResults(self.fixture) self.assertTrue(hasattr(search_results_instance, 'total')) assert_equal(search_results_instance.total, 9)
def test_search_results_is_set(self): search_results_instance = SearchResults(self.fixture) self.assertTrue(hasattr(search_results_instance, 'search_results'))
def setUp(self): self.fixture = _get_fixture_data() self.multiple_pages_fixture = _get_fixture_multiple_pages_data() self.service = SearchResults(self.fixture)