From 52fdedba48fc99876ab562bee2c29052953f8430 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 16 Jul 2008 23:17:29 +0000 Subject: Fixed #7759 -- Fixed QuerySet.count() when the results cache was only partially populated. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7938 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/queries/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py index fb66c6214b..84d386dc83 100644 --- a/tests/regressiontests/queries/models.py +++ b/tests/regressiontests/queries/models.py @@ -830,5 +830,13 @@ another cursor. ... obj.save() ... if i > 10: break +Bug #7759 -- count should work with a partially read result set. +>>> count = Number.objects.count() +>>> qs = Number.objects.all() +>>> for obj in qs: +... qs.count() == count +... break +True + """} -- cgit v1.3