summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-08-17 09:43:56 -0700
committerTim Graham <timograham@gmail.com>2018-08-17 12:44:17 -0400
commitcae84904c6a5facc0edd75e030c775de437320e0 (patch)
treed8238736ce9dba36da0868bd10d95f84337a4375 /tests
parent9c93bf0903a26a7abee8eb25e1e70e77688f88b0 (diff)
[2.1.x] Refs #29015 -- Added database name to PostgreSQL database name too long exception.
Backport of bf17f5e88466e3f571065345f5b2fea0d8af89fe from master
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/postgresql/tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/backends/postgresql/tests.py b/tests/backends/postgresql/tests.py
index e64e097fd1..6fd0ba4420 100644
--- a/tests/backends/postgresql/tests.py
+++ b/tests/backends/postgresql/tests.py
@@ -48,9 +48,10 @@ class Tests(TestCase):
max_name_length = connection.ops.max_name_length()
settings['NAME'] = 'a' + (max_name_length * 'a')
msg = (
- 'Database names longer than %d characters are not supported by '
- 'PostgreSQL. Supply a shorter NAME in settings.DATABASES.'
- ) % max_name_length
+ "The database name '%s' (%d characters) is longer than "
+ "PostgreSQL's limit of %s characters. Supply a shorter NAME in "
+ "settings.DATABASES."
+ ) % (settings['NAME'], max_name_length + 1, max_name_length)
with self.assertRaisesMessage(ImproperlyConfigured, msg):
DatabaseWrapper(settings).get_connection_params()