0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00
Commit Graph

67 Commits

Author SHA1 Message Date
Karl Hobley
0fd99886a2 Move tests to test 2022-03-17 17:19:59 +00:00
Dan Braghis
d10f15e558 Reformat with black 2022-02-15 13:06:17 +00:00
Matt Westcott
6e1e36256a Remove elasticsearch 2 support 2020-11-05 12:04:12 +00:00
Matt Westcott
9947b955da Lint config fixes (#6473)
Ref #6463, #6428

* pin isort to 5.6.4
* update isort version mentioned in python_guidelines.rst
* make lint commands consistent between make lint and circleci
* fix isort errors on files outside of /wagtail
* speed up isort by ignoring additional directories and filetypes
2020-10-19 21:33:10 +01:00
Matt Westcott
43cb1f7811 Add --disabletimezone option to runtests.py 2020-08-26 17:02:36 +01:00
Matt Westcott
0f637a22de Add emailuser test run to Travis 2020-08-26 17:02:36 +01:00
Matt Westcott
afb51eafbe Add --emailuser flag to runtests.py to enable the EmailUser model
wagtail.admin.tests.test_password_reset (currently the only test module where EmailUser is in use) has been updated to skip the CustomUser or EmailUser-specific test according to the active AUTH_USER_MODEL, and so this now succeeds with or without the `--emailuser` flag.
2020-08-26 17:02:36 +01:00
pySilver
0149eff66a Implements ES7 support (#5611)
* Implements ES7 support

* Linter fix

* Adds docs

* isort fix

* Fixes typo
2019-10-10 11:00:14 +01:00
Karl Hobley
e5a4208774 Add rudimentary benchmarking code and a couple of benchmarks
This commit implements a '--bench' argument for runtests.py. When
specified, this runs a couple of special "benchmark" tests that are
specifically created for testing performance of the explorer page.

It's very rudimentary at the moment as I needed something quickly to
implement the performance improvement in this PR. It gets the job done
though.
2018-06-11 17:49:31 +01:00
Karl Hobley
135a62051b Added Elasticsearch 6 backend 2018-05-04 15:57:35 +01:00
Mads Jensen
8b420b9abc Removed __future__ imports
Also delete add_imports directive from isort configuration
2017-11-27 02:18:30 +00:00
Karl Hobley
0a52196c63 Remove ES 1.x from test configuration 2017-11-06 14:27:27 +00:00
Bertrand Bordage
9db5b45ec7 Replace every remaining mention of postgresql_psycopg2.
PostgreSQL search backend were not running because of this since 67b1ddb665 (diff-c2cc727a5e1fca9050dea34af68aa13c)
2017-10-18 21:10:49 +01:00
Patrick Woods
fa853de486 Use parse_known_args so we can handle extra testrunner named parameters 2017-10-13 16:35:03 +01:00
Karl Hobley
93cc470d4b Added Elasticsearch 5 backend tests 2016-11-30 16:31:19 +00:00
Tim Heap
1849e9edf7 Only show imminent DeprecationWarnings by default
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.
2016-11-01 16:53:52 +00:00
Karl Hobley
daa82936d7 Elasticsearch 2 support (#2573)
* 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
2016-08-31 13:46:57 +03:00
Matt Westcott
58f747b955 Forcibly delete ELASTICSEARCH_URL from environment to skip those tests unless --elasticsearch specified 2016-05-03 17:19:29 +01:00
Tim Heap
0097f770fd Add options to filter deprecation warnings in tests
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.
2016-04-12 17:00:33 +01:00
Karl Hobley
7459329d93 Added --elasticsearch argument to runtests.py 2015-11-09 12:13:07 +00:00
Karl Hobley
126761db51 Added --postgres argument to runtests.py
Makes running the tests against PostgreSQL a bit easier
2015-11-09 12:04:50 +00:00
Karl Hobley
f4706b8208 Ignore ResourceWarnings
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.
2015-10-29 10:21:56 +00:00
Karl Hobley
8c88de9d93 Show ResourceWarnings when running tests
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
2015-05-13 09:39:02 +01:00
Matt Westcott
547c29faf5 Deprecate the base_model parameter on InlinePanel - fixes #405 2015-02-04 16:13:38 +00:00
Karl Hobley
2617174692 Don't ignore DeprecationWarnings
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
2014-07-28 15:52:42 +01:00
Matt Westcott
1d0c01e5fa Merge branch 'feature/test-db-settings' of https://github.com/takeflight/wagtail into takeflight-feature/test-db-settings
Conflicts:
	runtests.py
2014-07-28 12:07:34 +01:00
Tim Heap
793fa3327b Pull all test database options from env variables
Just pulling two and assuming others broke the base configuration I was
using, which uses a different database name and has a password.
2014-07-09 15:44:17 +10:00
Karl Hobley
735cfe3767 Use UTC timezone in tests
This prevents Django from converting times in tests
2014-07-03 13:44:11 +01:00
Karl Hobley
ab518b6472 Merge branch 'master' into sitemaps 2014-07-02 17:21:20 +01:00
Karl Hobley
055b2e97e5 Made tests.settings like a real settings file 2014-06-30 15:08:09 +01:00
Karl Hobley
51505ff3d5 Separated test settings into its own module 2014-06-30 11:36:56 +01:00
Karl Hobley
d0fefc5f97 Merge branch 'master' into sitemaps
Conflicts:
	runtests.py
2014-06-23 13:45:37 +01:00
Karl Hobley
ee7aebc9da Added tests for sitemaps 2014-06-23 13:43:34 +01:00
Karl Hobley
4081206c77 Scrapped ElasticUtils, use Elasticsearch-py instead
Conflicts:
	wagtail/wagtailsearch/backends/elasticsearch.py
	wagtail/wagtailsearch/indexed.py
2014-06-20 10:29:57 +01:00
Dave Cranwell
b638cc01e9 Merge branch 'master' into feature/styleguide 2014-06-17 09:36:21 +01:00
Karl Hobley
ee222a387b Merge remote-tracking branch 'torchbox/master' into issue-25
Conflicts:
	runtests.py
2014-06-16 10:40:31 +01:00
Karl Hobley
4235450f5e Minor PEP8 fix 2014-06-16 10:31:05 +01:00
Karl Hobley
eb70c215e9 Added test for wagtailstyleguide 2014-06-11 09:48:07 +01:00
Karl Hobley
b35f6d9409 Added test to check that wagtailadmin behaves correctly when LOGIN_URL is not set 2014-06-06 12:52:00 +01:00
Karl Hobley
7e7910ba3b Added LOGIN_REDIRECT_URL to runtests.py settings 2014-06-02 13:41:00 +01:00
Matt Westcott
3042d6ef6a set USE_TZ=True in runtests to handle fixtures correctly on sqlite 2014-05-28 16:27:53 +01:00
Neal Todd
580e9130ad Ref issue 177, Elasticsearch timeout on Travis: Support passing configuration arguments to Elasticsearch. Also documenting Elasticsearch setup in Wagtail. 2014-05-28 12:05:35 +01:00
Matt Westcott
64357dc5e0 Merge branch 'master' into form-builder
Conflicts:
	wagtail/tests/fixtures/test.json
	wagtail/wagtailcore/tests.py
2014-05-09 09:57:40 +01:00
Matt Westcott
f68f9a0461 add tests for front-end form submission 2014-05-07 16:39:56 +01:00
Karl Hobley
503f1cbaf8 Added comment into runtests.py to explain why we're using DatabaseCache 2014-05-02 12:33:20 +01:00
Karl Hobley
360174e230 Use database cache for testing
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
2014-05-02 11:45:31 +01:00
Matt Westcott
16ca3ce280 Add MySQL to tox tests 2014-05-01 12:21:17 +01:00
Matt Westcott
aa09c442a2 add tox test environment for sqlite, and include elasticsearch 2014-04-24 15:34:59 +01:00
Matt Westcott
46d594230d Add hooks to insert custom CSS/JS into the editor interface 2014-04-04 15:50:39 +01:00
Matt Westcott
4f807cb4e2 Add page permission tests (and fix the ever-so-subtle bug in preventing moves into a descendant page) 2014-03-04 15:47:16 +00:00