On 6/6/2011 10:19 PM, Ramiro Morales wrote:
On Sun, Jun 5, 2011 at 5:18 PM, Ned Batchelder<[email protected]> wrote:
When I try this on a PostgreSQL database, I have problems relating to
violated uniqueness constraints, sometimes from tests themselves, sometimes
from setUpClass, sometimes from tearDownClass. In the latter two cases,
it's the sites table involved. Is this something others have dealt with, or
am I on my own? :)
I tried adding a PostgreSQL "disable constraints" statement here:
https://github.com/jbalogh/test-utils/blob/master/test_utils/__init__.py#L109
cursor.execute('SET CONSTRAINT ALL DEFERRED')
It didn't help.
This might be related to ticket [1]#11665, a knownissue in the TestCase
handling of constraints with pg. Suggestion athere si to use
SET CONSTRAINTS ALL IMMEDIATE
before the rollback.
HTH
Thanks for the idea, but it did not help, which makes sense to me. The
ticket in question is complaining that TestCase doesn't throw enough
constraint violation exceptions, and suggests setting SET CONSTRAINT ALL
DEFERRED as a way to force problems to the surface. I'm trying to do
the opposite...
--Ned.
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.