summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-28 17:53:00 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-28 17:53:00 +0000
commitfa11a6a128886860d969c1b0315893948c062425 (patch)
tree7bfd83a69bbd33bcbee0f11ce8176420c675cf7a /tests
parent2f2908d7b5f5e4179c6ae185e3969fd66050ad23 (diff)
queryset-refactor: Fixed a problem in the test-suite that was annoying.
Only fails on PostgreSQL and only fails on the next test. Also identified the other area that causes both PostgreSQL backends (only) to fail. Don't really understand why at the moment, but this is the culprit. Tricky to reproduce, too, you have to run "queries" and "views" together, in that order to see it. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7174 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/one_to_one/models.py7
-rw-r--r--tests/regressiontests/queries/models.py4
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/modeltests/one_to_one/models.py b/tests/modeltests/one_to_one/models.py
index ab478c6118..e7b2668a85 100644
--- a/tests/modeltests/one_to_one/models.py
+++ b/tests/modeltests/one_to_one/models.py
@@ -6,7 +6,7 @@ To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
-from django.db import models
+from django.db import models, connection
class Place(models.Model):
name = models.CharField(max_length=50)
@@ -185,4 +185,9 @@ DoesNotExist: Restaurant matching query does not exist.
Traceback (most recent call last):
...
IntegrityError: ...
+
+# Because the unittests all use a single connection, we need to force a
+# reconnect here to ensure the connection is clean (after the previous
+# IntegrityError).
+>>> connection.close()
"""}
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py
index 50c002d14d..ada5f1cfc3 100644
--- a/tests/regressiontests/queries/models.py
+++ b/tests/regressiontests/queries/models.py
@@ -537,6 +537,10 @@ Test that parallel iterators work.
We can do slicing beyond what is currently in the result cache, too.
+# FIXME!! This next test causes really weird PostgreSQL behaviour, but it's
+# only apparent much later when the full test suite runs. I don't understand
+# what's going on here yet.
+
# We need to mess with the implemenation internals a bit here to decrease the
# cache fill size so that we don't read all the results at once.
>>> from django.db.models import query