Update test_single_result to use custom ordering

For consistency with other slicing tests
pull/3939/head
Karl Hobley 2017-10-19 16:58:13 +01:00
rodzic ecb52e9271
commit 8cf2c14619
3 zmienionych plików z 3 dodań i 19 usunięć

Wyświetl plik

@ -56,8 +56,3 @@ class TestPostgresSearchBackend(BackendTests, TestCase):
@unittest.expectedFailure
def test_order_by_non_filterable_field(self):
super(TestPostgresSearchBackend, self).test_order_by_non_filterable_field()
# Broken
@unittest.expectedFailure
def test_single_result(self):
super(TestPostgresSearchBackend, self).test_single_result()

Wyświetl plik

@ -331,16 +331,10 @@ class BackendTests(WagtailTestUtils):
# SLICING TESTS
def test_single_result(self):
# Note: different to test_ranking as that casts the results to the list before doing a key lookup
# This test sends the key IDs back into Elasticsearch, performing two separate queries
results = self.backend.search("JavaScript Definitive", models.Book, operator='or')
self.assertEqual(set(r.title for r in results), {
"JavaScript: The good parts",
"JavaScript: The Definitive Guide"
})
results = self.backend.search(None, models.Novel.objects.order_by('number_of_pages'), order_by_relevance=False)
self.assertEqual(results[0].title, "JavaScript: The Definitive Guide")
self.assertEqual(results[1].title, "JavaScript: The good parts")
self.assertEqual(results[0].title, "Foundation")
self.assertEqual(results[1].title, "The Hobbit")
def test_limit(self):
# Note: we need consistant ordering for this test

Wyświetl plik

@ -40,11 +40,6 @@ class TestDBBackend(BackendTests, TestCase):
def test_order_by_non_filterable_field(self):
super(TestDBBackend, self).test_order_by_non_filterable_field()
# Broken
@unittest.expectedFailure
def test_single_result(self):
super(TestDBBackend, self).test_single_result()
# Doesn't support the index API used in this test
@unittest.expectedFailure
def test_same_rank_pages(self):