Moves an elasticsearch test to all search backends.

This commit is contained in:
Bertrand Bordage 2017-06-19 03:27:20 +02:00
parent 9beab7b999
commit e61980de1c
3 changed files with 8 additions and 4 deletions

View file

@ -174,6 +174,10 @@ class BackendTests(WagtailTestUtils):
results = self.backend.search("World", models.SearchTestChild.objects.filter(id=self.testd.id))
self.assertEqual(set(results), {self.testd})
def test_related_objects_search(self):
results = self.backend.search("A subobject", models.SearchTest)
self.assertEqual(set(results), {self.testa})
def test_delete(self):
# Delete one of the objects
self.backend.delete(self.testa)

View file

@ -16,6 +16,10 @@ class TestDBBackend(BackendTests, TestCase):
def test_callable_indexed_field(self):
super(TestDBBackend, self).test_callable_indexed_field()
@unittest.expectedFailure
def test_related_objects_search(self):
super(TestDBBackend, self).test_related_objects_search()
@unittest.expectedFailure
def test_update_index_command(self):
super(TestDBBackend, self).test_update_index_command()

View file

@ -90,10 +90,6 @@ class TestElasticsearchSearchBackend(BackendTests, TestCase):
self.assertEqual(len(results), 1)
self.assertEqual(results[0].id, obj.id)
def test_related_objects_search(self):
results = self.backend.search("A subobject", models.SearchTest)
self.assertEqual(set(results), {self.testa})
def test_ascii_folding(self):
# Reset the index
self.reset_index()