Ticket #2879: run_test_server_utils.py.diff

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

The second part of the patch

  • django/test/utils.py

     
    108108    # If we're using SQLite, it's more convenient to test against an
    109109    # in-memory database.
    110110    if settings.DATABASE_ENGINE == "sqlite3":
    111         TEST_DATABASE_NAME = ":memory:"
     111        if settings.TEST_DATABASE_NAME:
     112            TEST_DATABASE_NAME = settings.TEST_DATABASE_NAME
     113        else:       
     114            tdn = settings.DATABASE_NAME.rpartition("/")
     115            TEST_DATABASE_NAME = tdn[0] + tdn[1] + "test_" + tdn[2]
    112116    else:
    113117        suffix = {
    114118            'postgresql': get_postgresql_create_suffix,
Back to Top