Tweaked the skipping condition for the test introduced in r17128 so that it works on non-PostgreSQL backends.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin 2011-11-20 20:43:59 +00:00
parent 74b836abf5
commit 78a2719def
1 changed files with 3 additions and 4 deletions

View File

@ -235,10 +235,9 @@ class PostgresNewConnectionTest(TestCase):
#17062: PostgreSQL shouldn't roll back SET TIME ZONE, even if the first #17062: PostgreSQL shouldn't roll back SET TIME ZONE, even if the first
transaction is rolled back. transaction is rolled back.
""" """
@unittest.skipUnless(connection.vendor == 'postgresql', @unittest.skipUnless(
"Test valid only for PostgreSQL") connection.vendor == 'postgresql' and connection.isolation_level > 0,
@unittest.skipUnless(connection.isolation_level > 0, "This test applies only to PostgreSQL without autocommit")
"Test valid only if not using autocommit")
def test_connect_and_rollback(self): def test_connect_and_rollback(self):
new_connections = ConnectionHandler(settings.DATABASES) new_connections = ConnectionHandler(settings.DATABASES)
new_connection = new_connections[DEFAULT_DB_ALIAS] new_connection = new_connections[DEFAULT_DB_ALIAS]