#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 --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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to