From fd95cc0517e0b5a0774ae8ad9e6677f3cc3001a2 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 11 Feb 2014 16:18:47 +0000 Subject: [PATCH] Fixed crash when tests are run without WAGTAILSEARCH_BACKENDS setting set --- wagtail/wagtailsearch/tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wagtail/wagtailsearch/tests.py b/wagtail/wagtailsearch/tests.py index 6849d3907..5f7d03c76 100644 --- a/wagtail/wagtailsearch/tests.py +++ b/wagtail/wagtailsearch/tests.py @@ -17,8 +17,11 @@ from wagtail.wagtailsearch.backends.elasticsearch import ElasticSearch def find_backend(cls): - if not hasattr(settings, 'WAGTAILSEARCH_BACKENDS') and cls == DBSearch: - return 'default' + if not hasattr(settings, 'WAGTAILSEARCH_BACKENDS'): + if cls == DBSearch: + return 'default' + else: + return for backend in settings.WAGTAILSEARCH_BACKENDS.keys(): if isinstance(get_search_backend(backend), cls):