Ticket #18019: 18019-2.diff

File 18019-2.diff, 998 bytes (added by claudep, 3 years ago)

Use test_db_allows_multiple_connections to determine threading capabilities

  • django/core/management/commands/testserver.py

    diff --git a/django/core/management/commands/testserver.py b/django/core/management/commands/testserver.py
    index 2e0d8e4..97fc8ea 100644
    a b class Command(BaseCommand): 
    3535        # a strange error -- it causes this handle() method to be called
    3636        # multiple times.
    3737        shutdown_message = '\nServer stopped.\nNote that the test database, %r, has not been deleted. You can explore it on your own.' % db_name
    38         call_command('runserver', addrport=addrport, shutdown_message=shutdown_message, use_reloader=False, use_ipv6=options['use_ipv6'])
     38        use_threading = connection.features.test_db_allows_multiple_connections
     39        call_command('runserver',
     40            addrport=addrport,
     41            shutdown_message=shutdown_message,
     42            use_reloader=False,
     43            use_ipv6=options['use_ipv6'],
     44            use_threading=use_threading
     45        )
Back to Top