Code

Opened 9 months ago

Closed 9 months ago

#21234 closed Uncategorized (duplicate)

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

Reported by: vernondcole Owned by: nobody
Component: Uncategorized Version: master
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 timo)

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,
            },

    }

}

Attachments (0)

Change History (3)

comment:1 Changed 9 months ago by mjtamlyn

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 9 months ago by timo

  • Description modified (diff)

comment:3 Changed 9 months ago by timo

  • Resolution set to duplicate
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.