summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-15 18:47:32 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-15 18:47:32 +0000
commit3b37c8151a06a2bebd51007db30ad436811b82c8 (patch)
tree2384a2408fcf22a7d014f3e8244f3845d17c54c1 /tests
parente867c5a0cc29977e926a836079061bf6a817f9af (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/queries/models.py14
1 files changed, 12 insertions, 2 deletions
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
+
"""}