From fa11a6a128886860d969c1b0315893948c062425 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Thu, 28 Feb 2008 17:53:00 +0000 Subject: [PATCH] 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 --- tests/modeltests/one_to_one/models.py | 7 ++++++- tests/regressiontests/queries/models.py | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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