Otherwise the PendingDeprecationWarnings for the next version of Django
become very noisy. The PendingDeprecationWarnings are generally ignored
because of the large range of Django versions supported, so printing
them by default causes nothing but noise. This causes actual warnings to
be ignored.
* Created Elasticsearch 2 backend
* Added tests for Elasticsearch 2 backend
* Split models up into different indices
pages, images and documents are now in separate indices
* Prefix fields of child models to prevent mapping clashes
* Replaced index_analyzer with analyzer/search_analyzer
index_analyzer has been removed in Elasticsearch 2.0
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html#_analyzer_mappings
There's no indication in Elasticsearch's docs that this wouldn't work on Elasticsearch 1.x. However, we found that the new configuration isn't reliable on Elasticsearch 1.6 and below (causes the test_query_analyzer test to fail randomly).
* Implemented new way of representing content types in search index
Instead of using a long string of model names that is queried using a
"prefix" query, we instead use a multi-value string field and query it
using a simple "match" query.
The only reason why this isn't implemented in the Elasticsearch 1.x
backend yet is backwards compatibility
* Added another child model of SearchTest with clashing field mapping
This checks that the namespacing of fields on child models is working properly (if it doesn't the update_index tests will fail)
* Added tests for get_model_root function
* fixup! Added tests for get_model_root function
* Docs updates for Elasticsearch 2 support
Also tweak examples to use elasticsearch2 backend by default
* Test against Elasticsearch 2 on travis
The test output was extremely noisy with deprecation warnings. Half of
these warnings were caused by external modules like django-taggit, and
could be ignored. The warnings caused by Wagtail got lost in the noise
though, rendering the test output useless for finding warnings. By
default, the tests now only print deprecation warnings if raised by
Wagtail.
Use `./runtests.py --deprecation=all` if you want all the warnings to be
printed. This is useful when we want to fix third party packages before
they break from being too outdated.
Use `./runtests.py --deprecation=pending` if you want the default
behaviour.
Use `./runtests.py --deprecation=imminent` if you only want imminent
DeprecationWarnings, ignoring PendingDeprecationWarnings.
Use `./runtests.py --deprecation=none` if you want to ignore all
deprecation warnings.
This switches Python back to it's default behaviour. Elasticsearch creates a lot of noise with this warning switched on, hiding warnings that may be important.
This warning is raised when a file is opened inside a test, but not closed. This can help spot bugs in Wagtail.
ResourceWarning was added in Python 3.2 and isn't available in Python 2
This was previously done for us in Django 1.6. But they reverted back to the default Python configuration to ignore these warnings causing a test to break
0c6a339952
Currently, the cache is not flushed between tests.
This can cause false positives where a previous test has been messing with cache keys which a future test uses (eg, wagtail_root_paths)
This commit makes django use the database as the cache which is automatically flushed between tests