@@ -0,0 +1,1650 @@
+import pytest%0A%0Afrom django.test import TestCase%0Aimport search.views as views%0Afrom search import views as search_views%0A%0Afrom django.urls import reverse%0A%0Afrom haystack.forms import HighlightedSearchForm%0A%0Aclass SearchUrlTest(TestCase):%0A%0A    def test_search_url(self):%0A        %22%22%22 Tests the tag url %22%22%22%0A        url = reverse('search')%0A        self.assertEqual(url, '/search/')%0A%0Aclass SearchViewTest(TestCase):%0A%0A    def setUp(self):%0A        %22%22%22 Sets up necessary variables %22%22%22%0A        super(SearchViewTest, self).setUp()%0A        self.view = views.SearchView()%0A        self.viewVariable = views.SearchView(form_class='', results_per_page=20, template='')%0A%0A    def test_if_form_class(self):%0A        %22%22%22 Tests if there is a form class %22%22%22%0A        form_class = self.viewVariable.form_class%0A        test_form_class = ''%0A        self.assertEqual(form_class, test_form_class, 'Form class is not skipping the if statement')%0A%0A    def test_if_not_form_class(self):%0A        %22%22%22 Tests if there is not a form class %22%22%22%0A        form_class = self.view.form_class%0A        test_form_class = HighlightedSearchForm%0A        self.assertEqual(form_class, test_form_class, 'Form class is not assinging HighlightedSearchForm')%0A%0A    def test_if_results_per_page(self):%0A        %22%22%22 Tests if there are results per page %22%22%22%0A        results_per_page = self.viewVariable.results_per_page%0A        self.assertEqual(results_per_page, 20, 'The test results were not the same')%0A%0A    def test_if_template(self):%0A        %22%22%22 Tests if there is a template %22%22%22%0A        template = self.viewVariable.template%0A        self.assertEqual(template, 'search/search.html', 'The template was not passed')%0A

test search views