On Tue, Jun 21, 2011 at 12:48 PM, Peter Russell <[email protected]> wrote: > I've just been writing a test which checks that a delete() method > works correctly. The test passes, but on closer inspection it should > have failed, because creating my object creates a second object which > is not being deleted. In principle Postgres will raise an > IntegrityError about this, but because all foreign keys are created > "DEFERRABLE INITIALLY DEFERRED", the check doesn't happen until the > transaction is committed... which doesn't happen. If I switch to > using TransactionTestCase (which is massively slower), the test fails > as expected. > > I haven't tested this yet, but I suspect that if I modified the Django > TestCase code to emit "SET CONSTRAINTS ALL IMMEDIATE;" before it > truncates the tables my IntegrityError will be raised.
That's what [1]ticket 11665 reports. -- 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.
