Code

Ticket #2879: run_test_server_utils.py.diff

File run_test_server_utils.py.diff, 707 bytes (added by Denis Golomazov <denis.golomazov@…>, 6 years ago)

The second part of the patch

Line 
1Index: django/test/utils.py
2===================================================================
3--- django/test/utils.py        (revision 6708)
4+++ django/test/utils.py        (working copy)
5@@ -108,7 +108,11 @@
6     # If we're using SQLite, it's more convenient to test against an
7     # in-memory database.
8     if settings.DATABASE_ENGINE == "sqlite3":
9-        TEST_DATABASE_NAME = ":memory:"
10+        if settings.TEST_DATABASE_NAME:
11+            TEST_DATABASE_NAME = settings.TEST_DATABASE_NAME
12+        else:     
13+           tdn = settings.DATABASE_NAME.rpartition("/")
14+           TEST_DATABASE_NAME = tdn[0] + tdn[1] + "test_" + tdn[2]
15     else:
16         suffix = {
17             'postgresql': get_postgresql_create_suffix,