Skip to content

Commit

Permalink
Fixed a broken test introduced in 6fa7d7c. Refs #21553.
Browse files Browse the repository at this point in the history
Thanks Shai.
  • Loading branch information
aaugustin committed Apr 10, 2014
1 parent d5cef2a commit e68c084
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/backends/tests.py
Expand Up @@ -488,7 +488,7 @@ class BackendTestCase(TestCase):
def create_squares_with_executemany(self, args): def create_squares_with_executemany(self, args):
self.create_squares(args, 'format', True) self.create_squares(args, 'format', True)


def create_squares(self, args, paramstyle, multiple): def create_squares(self, args, paramstyle, multiple):
cursor = connection.cursor() cursor = connection.cursor()
opts = models.Square._meta opts = models.Square._meta
tbl = connection.introspection.table_name_converter(opts.db_table) tbl = connection.introspection.table_name_converter(opts.db_table)
Expand Down Expand Up @@ -560,7 +560,7 @@ def test_cursor_executemany_with_pyformat_iterator(self):
# same test for DebugCursorWrapper # same test for DebugCursorWrapper
self.create_squares(args, 'pyformat', multiple=True) self.create_squares(args, 'pyformat', multiple=True)
self.assertEqual(models.Square.objects.count(), 9) self.assertEqual(models.Square.objects.count(), 9)

def test_unicode_fetches(self): def test_unicode_fetches(self):
#6254: fetchone, fetchmany, fetchall return strings as unicode objects #6254: fetchone, fetchmany, fetchall return strings as unicode objects
qn = connection.ops.quote_name qn = connection.ops.quote_name
Expand Down Expand Up @@ -627,8 +627,7 @@ def test_is_usable_after_database_disconnects(self):
Regression for #21553. Regression for #21553.
""" """
# Open a connection to the database. # Open a connection to the database.
with connection.cursor(): connection.cursor().close()
pass
# Emulate a connection close by the database. # Emulate a connection close by the database.
connection._close() connection._close()
# Even then is_usable() should not raise an exception. # Even then is_usable() should not raise an exception.
Expand Down

0 comments on commit e68c084

Please sign in to comment.