User percent encoded name of inexistant database
Closes #14801 (grafted from 5fddfb00cfffa81177c0b5ddda6aaecaccfe19da) --HG-- branch : 8.0
This commit is contained in:
@@ -547,7 +547,8 @@ class Database(DatabaseInterface):
|
||||
db_path = safe_join(
|
||||
config.get('database', 'path'), self.name + '.sqlite')
|
||||
if not os.path.isfile(db_path):
|
||||
raise IOError("Database '%s' doesn't exist!" % db_path)
|
||||
raise DatabaseOperationalError(
|
||||
f"Database '{db_path}' doesn't exist!")
|
||||
db_uri = base_uri._replace(path=db_path)
|
||||
|
||||
# Use unparse before replacing sqlite with file because SQLite accepts
|
||||
|
||||
@@ -33,8 +33,8 @@ class TransactionTestCase(TestCase):
|
||||
and ensure that it stops cleanly and allows starting of next
|
||||
transaction'''
|
||||
self.assertRaises(
|
||||
Exception, empty_transaction, "Non existant DB", USER,
|
||||
context=CONTEXT)
|
||||
backend.DatabaseOperationalError, empty_transaction,
|
||||
"Non%20existant%20DB", USER, context=CONTEXT)
|
||||
self.assertTrue(empty_transaction(DB_NAME, USER, context=CONTEXT))
|
||||
|
||||
def test_set_user(self):
|
||||
|
||||
Reference in New Issue
Block a user