Opened 10 years ago

Closed 10 years ago

#21234 closed Uncategorized (duplicate)

DATABASES['other']['TEST_NAME'] is ignored is some situations.

Reported by: Vernon Cole Owned by: nobody
Component: Uncategorized Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

Attempting to test django using the following settings fails with an infinite wait. It appears that 'TEST_NAME' is ignored, causing conflicting use of the (single) database.

I have determined that if DATABASES['default']['NAME'] != DATABASES['other']['NAME'] then 'TEST_NAME' works correctly.

 DATABASES = {

    'default': {

        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'adotest',
        'USER': 'adotestuser',
        'PASSWORD': '12345678',
        'HOST': 'localhost',
        'OPTIONS': {

            'autocommit': True,
            },

        },

    'other': {

        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'adotest',
        'TEST_NAME': 'other_test',
        'USER': 'adotestuser',
        'PASSWORD': '12345678',
        'HOST': 'localhost',
        'OPTIONS': {

            'autocommit': True,
            },

    }

}

Change History (3)

comment:1 by Marc Tamlyn, 10 years ago

Why would you have DATABASES['default']['NAME'] == DATABASES['other']['NAME']? This seems illogical to me.

comment:2 by Tim Graham, 10 years ago

Description: modified (diff)

comment:3 by Tim Graham, 10 years ago

Resolution: duplicate
Status: newclosed

It seems likely you are running into #16969 which suggests to avoid selecting the production database prior to test database setup/teardown.

Note: See TracTickets for help on using tickets.
Back to Top