summaryrefslogtreecommitdiff
path: root/tests/transaction_hooks
diff options
context:
space:
mode:
authorMads Jensen <mje@inducks.org>2017-05-28 21:37:21 +0200
committerTim Graham <timograham@gmail.com>2017-07-29 19:07:23 -0400
commita51c4de1945be2225f20fad794cfb52d8f1f9236 (patch)
tree36386b70a27cf027a8a491de319c3e59e0d3d0cd /tests/transaction_hooks
parent38988f289f7f5708f5ea85de2d5dfe0d86b23106 (diff)
Used assertRaisesMessage() to test Django's error messages.
Diffstat (limited to 'tests/transaction_hooks')
-rw-r--r--tests/transaction_hooks/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/transaction_hooks/tests.py b/tests/transaction_hooks/tests.py
index 049211139d..ed3cf18be2 100644
--- a/tests/transaction_hooks/tests.py
+++ b/tests/transaction_hooks/tests.py
@@ -214,7 +214,8 @@ class TestConnectionOnCommit(TransactionTestCase):
try:
connection.set_autocommit(False)
- with self.assertRaises(transaction.TransactionManagementError):
+ msg = 'on_commit() cannot be used in manual transaction management'
+ with self.assertRaisesMessage(transaction.TransactionManagementError, msg):
transaction.on_commit(should_never_be_called)
finally:
connection.set_autocommit(True)