diff options
Diffstat (limited to 'tests/basic/tests.py')
| -rw-r--r-- | tests/basic/tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/basic/tests.py b/tests/basic/tests.py index 44ace3d684..1d91e39ce9 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -805,8 +805,9 @@ class SelectOnSaveTests(TestCase): "An error occurred in the current transaction. You can't " "execute queries until the end of the 'atomic' block." ) - with self.assertRaisesMessage(DatabaseError, msg): + with self.assertRaisesMessage(DatabaseError, msg) as cm: asos.save(update_fields=["pub_date"]) + self.assertIsInstance(cm.exception.__cause__, DatabaseError) finally: Article._base_manager._queryset_class = orig_class |
