#35226: Copying a connection with a new alias fails
-----------------------------------+--------------------------------------
Reporter: Florian Apolloner | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 5.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Comment (by Mariusz Felisiak):
We could ignore dynamically created connections, e.g.:
{{{#!diff
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 51b07ae50d..768ebd7d52 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -280,6 +280,7 @@ class SimpleTestCase(unittest.TestCase):
self.connection is None
and self.alias not in cls.databases
and self.alias != NO_DB_ALIAS
+ and self.alias in connections
):
# Connection has not yet been established, but the alias
is not allowed.
message = cls._disallowed_database_msg % {
}}}
What do you think?
--
Ticket URL: <https://code.djangoproject.com/ticket/35226#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018dc060f731-46b57c0b-f54b-4ea4-9e62-167bd333bc4d-000000%40eu-central-1.amazonses.com.