search.controllers.advanced.tests module¶
Tests for advanced search controller, search.controllers.advanced
.
-
class
search.controllers.advanced.tests.
TestAdvancedSearchForm
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for
AdvancedSearchForm
.-
test_date_range_must_be_specified
()[source]¶ If the user selects date range, they must indicate start or end.
-
test_date_range_supports_variable_precision
()[source]¶ Date range in advanced search should support variable precision.
-
test_querystring_has_unbalanced_quotes
()[source]¶ Querystring has an odd number of quote characters.
-
-
class
search.controllers.advanced.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 term.
-
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.advanced.tests.
TestMultiFormatDateField
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests the
MultiFormatDateField
.
-
class
search.controllers.advanced.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.advanced.tests.
TestSearchController
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Tests for
advanced.search()
.
-
class
search.controllers.advanced.tests.
TestUpdateQueryWithDates
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
advanced._update_query_with_dates()
applies date selections.
-
class
search.controllers.advanced.tests.
TestUpdateQueryWithFieldedTerms
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
advanced._update_query_with_terms()
adds primary search terms.
-
class
search.controllers.advanced.tests.
TestUpdatequeryWithClassification
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
advanced._update_query_with_classification()
adds classfnxn.-
test_multiple_classifications_are_selected
()[source]¶ Selected classifications are added to the query.
-