コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)