Skip to content

Commit a947dc3

Browse files
authored
Merge pull request django-haystack#1754 from django-doctor/django-doctor-fix-1611124784275.3516
Improve the performance of ORM calls
2 parents f64d8d2 + 902ae45 commit a947dc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test_haystack/test_indexes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ def test_proper_fields(self):
245245
self.assertTrue(isinstance(self.cmi.fields["extra"], indexes.CharField))
246246

247247
def test_index_queryset(self):
248-
self.assertEqual(len(self.cmi.index_queryset()), 3)
248+
self.assertEqual(self.cmi.index_queryset().count(), 3)
249249

250250
def test_read_queryset(self):
251-
self.assertEqual(len(self.cmi.read_queryset()), 2)
251+
self.assertEqual(self.cmi.read_queryset().count(), 2)
252252

253253
def test_build_queryset(self):
254254
# The custom SearchIndex.build_queryset returns the same records as
255255
# the read_queryset
256-
self.assertEqual(len(self.cmi.build_queryset()), 2)
256+
self.assertEqual(self.cmi.build_queryset().count(), 2)
257257

258258
# Store a reference to the original method
259259
old_guf = self.mi.__class__.get_updated_field

0 commit comments

Comments
 (0)