mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-12 01:03:11 +00:00
Split up backend tests
This commit is contained in:
parent
2100c6372d
commit
2679dc2fe6
3 changed files with 31 additions and 21 deletions
|
|
@ -151,27 +151,6 @@ class BackendTests(object):
|
|||
self.assertEqual(len(results), 3)
|
||||
|
||||
|
||||
class TestDBBackend(BackendTests, TestCase):
|
||||
backend_path = 'wagtail.wagtailsearch.backends.db.DBSearch'
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_callable_indexed_field(self):
|
||||
super(TestDBBackend, self).test_callable_indexed_field()
|
||||
|
||||
|
||||
class TestElasticSearchBackend(BackendTests, TestCase):
|
||||
backend_path = 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch'
|
||||
|
||||
def test_search_with_spaces_only(self):
|
||||
# Search for some space characters and hope it doesn't crash
|
||||
results = self.backend.search(" ", models.SearchTest)
|
||||
|
||||
# Queries are lazily evaluated, force it to run
|
||||
list(results)
|
||||
|
||||
# Didn't crash, yay!
|
||||
|
||||
|
||||
@override_settings(WAGTAILSEARCH_BACKENDS={
|
||||
'default': {'BACKEND': 'wagtail.wagtailsearch.backends.db.DBSearch'}
|
||||
})
|
||||
|
|
|
|||
13
wagtail/wagtailsearch/tests/test_db_backend.py
Normal file
13
wagtail/wagtailsearch/tests/test_db_backend.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
from wagtail.tests.utils import unittest
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from .test_backends import BackendTests
|
||||
|
||||
|
||||
class TestDBBackend(BackendTests, TestCase):
|
||||
backend_path = 'wagtail.wagtailsearch.backends.db.DBSearch'
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_callable_indexed_field(self):
|
||||
super(TestDBBackend, self).test_callable_indexed_field()
|
||||
18
wagtail/wagtailsearch/tests/test_elasticsearch_backend.py
Normal file
18
wagtail/wagtailsearch/tests/test_elasticsearch_backend.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from wagtail.tests.utils import unittest
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from .test_backends import BackendTests
|
||||
|
||||
|
||||
class TestElasticSearchBackend(BackendTests, TestCase):
|
||||
backend_path = 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch'
|
||||
|
||||
def test_search_with_spaces_only(self):
|
||||
# Search for some space characters and hope it doesn't crash
|
||||
results = self.backend.search(" ", models.SearchTest)
|
||||
|
||||
# Queries are lazily evaluated, force it to run
|
||||
list(results)
|
||||
|
||||
# Didn't crash, yay!
|
||||
Loading…
Reference in a new issue