Re: database error and connection._rollback

2012-08-23 Thread Mike Dewhirst
On 23/08/2012 4:27pm, akaariai wrote: On 23 elo, 08:30, Mike Dewhirst wrote: This ... [1] from django.db import connection connection._rollback() ... solved a problem for me in unit testing when I catch a deliberate DatabaseError. Django 1.4 Python 2.7 PostgreSQL 9.1

Re: database error and connection._rollback

2012-08-23 Thread akaariai
On 23 elo, 08:30, Mike Dewhirst wrote: > This ... [1] > > from django.db import connection > connection._rollback() > > ... solved a problem for me in unit testing when I catch a deliberate > DatabaseError. > > Django 1.4 > Python 2.7 > PostgreSQL 9.1 > > My question: Is it

database error and connection._rollback

2012-08-22 Thread Mike Dewhirst
This ... [1] from django.db import connection connection._rollback() ... solved a problem for me in unit testing when I catch a deliberate DatabaseError. Django 1.4 Python 2.7 PostgreSQL 9.1 My question: Is it safe enough to use a method with a leading underscore? Is there a better method?