def test_get_breadcrumb_if_referrer_is_search_page_with_query(self): request = HttpRequest() search_path_with_query = reverse("prepaid_agreements:index") + "?q=a" request.META.update({'HTTP_REFERER': search_path_with_query}) self.assertEqual(get_detail_page_breadcrumb(request), search_path_with_query)
def test_get_breadcrumb_if_referrer_is_not_search_page(self): request = HttpRequest() search_path = reverse("prepaid_agreements:index") request.META.update({'HTTP_REFERER': '/random-path/'}) self.assertEqual(get_detail_page_breadcrumb(request), search_path)
def test_get_breadcrumb_if_no_referrer(self): request = HttpRequest() search_path = reverse("prepaid_agreements:index") self.assertEqual(get_detail_page_breadcrumb(request), search_path)