summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-09-10 18:58:30 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-09-10 18:58:30 +0000
commitfcee0c1b66019a0e84bc338e76fa31695d5bd4ca (patch)
tree4323649b5df9c56367e11997d6455a941b093b57 /tests
parent161c6328a0811280926a16275be5ef4164f5866f (diff)
Fixed #16809 -- Forced MySQL to behave like a database. This avoids a problem where queries that do IS NONE checks can return the wrong result the first time they are executed if there is a recently inserted row. Thanks to James Pyrich for the debug work and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16785 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/queries/tests.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
index 708e60da85..d8fd5bc9ce 100644
--- a/tests/regressiontests/queries/tests.py
+++ b/tests/regressiontests/queries/tests.py
@@ -1070,10 +1070,6 @@ class Queries4Tests(BaseQuerysetTest):
ci3 = CategoryItem.objects.create(category=c3)
qs = CategoryItem.objects.exclude(category__specialcategory__isnull=False)
- # Under MySQL, this query gives incorrect values on the first attempt.
- # If you run exactly the same query twice, it yields the right answer
- # the second attempt. Oh, how we do love MySQL.
- qs.count()
self.assertEqual(qs.count(), 1)
self.assertQuerysetEqual(qs, [ci1.pk], lambda x: x.pk)
@@ -1136,10 +1132,6 @@ class Queries4Tests(BaseQuerysetTest):
ci3 = CategoryItem.objects.create(category=c1)
qs = CategoryItem.objects.exclude(category__onetoonecategory__isnull=False)
- # Under MySQL, this query gives incorrect values on the first attempt.
- # If you run exactly the same query twice, it yields the right answer
- # the second attempt. Oh, how we do love MySQL.
- qs.count()
self.assertEqual(qs.count(), 1)
self.assertQuerysetEqual(qs, [ci1.pk], lambda x: x.pk)
@@ -1421,11 +1413,6 @@ class Queries6Tests(TestCase):
[]
)
- # This next makes exactly *zero* sense, but it works. It's needed
- # because MySQL fails to give the right results the first time this
- # query is executed. If you run the same query a second time, it
- # works fine. It's a hack, but it works...
- list(Tag.objects.exclude(children=None))
self.assertQuerysetEqual(
Tag.objects.exclude(children=None),
['<Tag: t1>', '<Tag: t3>']