summaryrefslogtreecommitdiff
path: root/tests/backends
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2021-10-01 07:23:57 +0200
committerGitHub <noreply@github.com>2021-10-01 07:23:57 +0200
commit98c8bf1ceeab5c68751c83555f82cff1a9120a67 (patch)
tree45084610ab4d18818dafd77a0935772481cb41cb /tests/backends
parent492ed60f236d770eb9a6d56d85ff2550bb1ecfff (diff)
downloaddjango-98c8bf1ceeab5c68751c83555f82cff1a9120a67.tar.gz
Fixed #33160 -- Avoided suppressing query errors in _nodb_cursor() on PostgreSQL.
Diffstat (limited to 'tests/backends')
-rw-r--r--tests/backends/postgresql/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/backends/postgresql/tests.py b/tests/backends/postgresql/tests.py
index 7f27c69ffb..e8dfcf2f62 100644
--- a/tests/backends/postgresql/tests.py
+++ b/tests/backends/postgresql/tests.py
@@ -103,6 +103,11 @@ class Tests(TestCase):
with connection._nodb_cursor():
pass
+ def test_nodb_cursor_reraise_exceptions(self):
+ with self.assertRaisesMessage(DatabaseError, 'exception'):
+ with connection._nodb_cursor():
+ raise DatabaseError('exception')
+
def test_database_name_too_long(self):
from django.db.backends.postgresql.base import DatabaseWrapper
settings = connection.settings_dict.copy()