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 -- Ramiro Morales 1. https://code.djangoproject.com/ticket/11665 -- 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.
