From 3b37c8151a06a2bebd51007db30ad436811b82c8 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 15 Jul 2008 18:47:32 +0000 Subject: Fixed #7411 -- worked around some possible transaction conflicts in SQLite. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7926 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/queries/models.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py index 65d0d6ec65..fb66c6214b 100644 --- a/tests/regressiontests/queries/models.py +++ b/tests/regressiontests/queries/models.py @@ -6,14 +6,14 @@ import datetime import pickle from django.db import models -from django.db.models.query import Q +from django.db.models.query import Q, ITER_CHUNK_SIZE # Python 2.3 doesn't have sorted() try: sorted except NameError: from django.utils.itercompat import sorted - + class Tag(models.Model): name = models.CharField(max_length=10) parent = models.ForeignKey('self', blank=True, null=True, @@ -820,5 +820,15 @@ Bug #7698 -- People like to slice with '0' as the high-water mark. >>> Item.objects.all()[0:0] [] +Bug #7411 - saving to db must work even with partially read result set in +another cursor. + +>>> for num in range(2 * ITER_CHUNK_SIZE + 1): +... _ = Number.objects.create(num=num) + +>>> for i, obj in enumerate(Number.objects.all()): +... obj.save() +... if i > 10: break + """} -- cgit v1.3