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