mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #35226 -- Reallowed executing queries for dynamically created connections.
Regression in 8fb0be3500.
Thanks Florian Apolloner for the report.
This commit is contained in:
@@ -2161,6 +2161,16 @@ class AllowedDatabaseQueriesTests(SimpleTestCase):
|
||||
conn.close()
|
||||
conn.dec_thread_sharing()
|
||||
|
||||
def test_allowed_database_copy_queries(self):
|
||||
new_connection = connection.copy("dynamic_connection")
|
||||
try:
|
||||
with new_connection.cursor() as cursor:
|
||||
sql = f"SELECT 1{new_connection.features.bare_select_suffix}"
|
||||
cursor.execute(sql)
|
||||
self.assertEqual(cursor.fetchone()[0], 1)
|
||||
finally:
|
||||
new_connection.close()
|
||||
|
||||
|
||||
class DatabaseAliasTests(SimpleTestCase):
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user