Re: django. postgre and errors (integrity errors not raised as expected in unit tests)

2009-03-23 Thread LD
OK. solved. The problem was that I did something like this: class MyModel(models.Model): field = #this field is marked as unique and then in tests: sid = transaction.savepoint() ml1 = MyModel(field = 'a') ml1.save() m2 = MyModel(field = 'b') self.assertRaises(IntegrityError, m2.save)

Re: django. postgre and errors (integrity errors not raised as expected in unit tests)

2009-03-23 Thread LD
Thanks for response, savepoint api looks nice and in fact it did the thing for some tests. But for some other I still got the same error - looks strange since tests are trying to do simmilar logic. I thought that problem was in some logic in test setUp, but again in both test cases there is

Re: django. postgre and errors (integrity errors not raised as expected in unit tests)

2009-03-20 Thread Malcolm Tredinnick
On Fri, 2009-03-20 at 16:26 -0700, LD wrote: > Hi, > > Today I enforced strange situation, hope it is strange only for me nad > you will quickly tell me what stupidness I am doing. > > Well, today I have switched from sqlite to postgre. Everything was > perfect since I've tried to run set of

django. postgre and errors (integrity errors not raised as expected in unit tests)

2009-03-20 Thread LD
Hi, Today I enforced strange situation, hope it is strange only for me nad you will quickly tell me what stupidness I am doing. Well, today I have switched from sqlite to postgre. Everything was perfect since I've tried to run set of unit tests for my project. Every time my tests deals with