search.controllers.simple.tests module¶
Tests for simple search controller, search.controllers.simple
.
-
class
search.controllers.simple.tests.
TestClassicAuthorSyntaxIsIntercepted
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
The user may have entered an author query using surname_f syntax.
This is an artefact of the classic search system, and not intended to be supported. Nevertheless, users have become accustomed to this syntax. We therefore rewrite the query using a comma, and show the user a warning about the syntax change.
-
test_all_fields_search_contains_classic_syntax
(mock_index)[source]¶ User has entered a surname_f query in an all-fields search.
-
test_all_fields_search_multiple_classic_syntax
(mock_index)[source]¶ User has entered a classic query with multiple authors.
User has entered a surname_f query in an author search.
-
-
class
search.controllers.simple.tests.
TestPaginationParametersAreFunky
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
The user may have monkeyed with the order or sort parameters.
Since these are limited to specific values, there is no other reason for them to be invalid. Given that they are passed around among views (to persist users’ selection), it’s important to break the chain. To do this, we return a 400 Bad Request, with a clean link back to the search form.
-
class
search.controllers.simple.tests.
TestQueryFromForm
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for
simple._query_from_form()
.
-
class
search.controllers.simple.tests.
TestRetrieveDocument
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for
simple.retrieve_document()
.
-
class
search.controllers.simple.tests.
TestSearchController
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for
simple.search()
.
-
class
search.controllers.simple.tests.
TestSimpleSearchForm
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for
SimpleSearchForm
.