Russell Many thanks for taking the time to reply.
On Oct 19, 6:13 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Sun, Oct 19, 2008 at 4:00 AM, Ian J Cottee <[EMAIL PROTECTED]> wrote: > As far as I can make out, the error you are getting is unrelated to > the problem you are describing. Your error is telling you that you > can't flush the database. If you're getting that error, Django hasn't > started to run the test yet, so the issue isn't with your test code. > If your test case contained nothing but "self.assertEquals(1,1)", you > would get the same error. The problem lies with the test database > itself. I did as you said. The issue is actually one that I now recall I reported last January http://tinyurl.com/5r6jm6 When a test fails and another test then runs, it dies because the transaction is in error. The field with too many chars fails and that causes the next test to raise an error. If you switch the backend to SQLLite for example you don't get any errors. Funnily enough, I can stop that happening by using the solution given at:: http://www.stereoplex.com/two-voices/django-unit-tests-and-transactions Although the comments to that article imply that Django's own unit test framework should be doing this? I think I have two questions now: 1. Is this a bug? Surely one test failing shouldn't affect the other tests? And surely running your unit tests against different backends should give the same result. and perhaps much more simply ... 2. How DO you test if an object is going to fail to be saved, before trying to save it? The validates method appears to have been removed now. For the record this is Django from svn using postgres 8.3 and psycopg2, running on Hardy, Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---