()
| 2327 | connections_dict = {} |
| 2328 | |
| 2329 | def thread_func(): |
| 2330 | # Passing django.db.connection between threads doesn't work while |
| 2331 | # connections[DEFAULT_DB_ALIAS] does. |
| 2332 | from django.db import connections |
| 2333 | |
| 2334 | connection = connections["default"] |
| 2335 | |
| 2336 | next(Car.objects.iterator(), None) |
| 2337 | |
| 2338 | # Allow thread sharing so the connection can be closed by the main |
| 2339 | # thread. |
| 2340 | connection.inc_thread_sharing() |
| 2341 | connections_dict[id(connection)] = connection |
| 2342 | |
| 2343 | try: |
| 2344 | t = threading.Thread(target=thread_func) |
nothing calls this directly
no test coverage detected