Merges again QueryAPITestMixin and BackendTest.

This commit is contained in:
Bertrand Bordage 2018-01-04 12:21:33 +01:00
parent 8e6dedac67
commit 14490978e5
4 changed files with 6 additions and 8 deletions

View file

@ -1,11 +1,11 @@
from django.test import TestCase
from wagtail.search.tests.test_backends import QueryAPITestMixin, BackendTests
from wagtail.search.tests.test_backends import BackendTests
from ..utils import BOOSTS_WEIGHTS, WEIGHTS_VALUES, determine_boosts_weights, get_weight
class TestPostgresSearchBackend(QueryAPITestMixin, BackendTests, TestCase):
class TestPostgresSearchBackend(BackendTests, TestCase):
backend_path = 'wagtail.contrib.postgres_search.backend'
def test_weights(self):

View file

@ -5,10 +5,10 @@ from django.core import management
from wagtail.tests.search import models
from wagtail.search.query import MATCH_ALL
from wagtail.search.tests.test_backends import BackendTests, QueryAPITestMixin
from wagtail.search.tests.test_backends import BackendTests
class ElasticsearchCommonSearchBackendTests(QueryAPITestMixin, BackendTests):
class ElasticsearchCommonSearchBackendTests(BackendTests):
def test_search_with_spaces_only(self):
# Search for some space characters and hope it doesn't crash
results = self.backend.search(" ", models.Book)

View file

@ -431,8 +431,6 @@ class BackendTests(WagtailTestUtils):
"The Fellowship of the Ring" # If this item doesn't appear, "Foundation" is still in the index
])
class QueryAPITestMixin:
#
# Basic query classes
#

View file

@ -2,10 +2,10 @@ import unittest
from django.test import TestCase
from .test_backends import BackendTests, QueryAPITestMixin
from .test_backends import BackendTests
class TestDBBackend(QueryAPITestMixin, BackendTests, TestCase):
class TestDBBackend(BackendTests, TestCase):
backend_path = 'wagtail.search.backends.db'
# Doesn't support ranking