diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-01 01:35:36 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-01 01:35:36 +0000 |
| commit | 283c89e4c61fa99dfdf6688a12ed3ce5a3945347 (patch) | |
| tree | 455aab0e8764d7f98e8e3af30896ecdac43e25fc /tests | |
| parent | 9b5b2ee2f3f64bdd71faf7631498d0892a7dbba2 (diff) | |
[1.0.X] Fixed #10202 -- Fixed another couple of slicing edge-cases with querysets.
Patch from Alex Gaynor and Ramiro Morales.
Backport of r9924 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9925 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/queries/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py index eb4db0cd19..755b9ffc3f 100644 --- a/tests/regressiontests/queries/models.py +++ b/tests/regressiontests/queries/models.py @@ -902,11 +902,17 @@ used in lookups. >>> Item.objects.filter(created__in=[time1, time2]) [<Item: one>, <Item: two>] -Bug #7698 -- People like to slice with '0' as the high-water mark. +Bug #7698, #10202 -- People like to slice with '0' as the high-water mark. >>> Item.objects.all()[0:0] [] >>> Item.objects.all()[0:0][:10] [] +>>> Item.objects.all()[:0].count() +0 +>>> Item.objects.all()[:0].latest('created') +Traceback (most recent call last): + ... +AssertionError: Cannot change a query once a slice has been taken. Bug #7411 - saving to db must work even with partially read result set in another cursor. |
