#33685: Using new postgresql settings fails when running tests
---------------------------------------------+------------------------
               Reporter:  Shane Ambler       |          Owner:  nobody
                   Type:  Bug                |         Status:  new
              Component:  Testing framework  |        Version:  4.0
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 In django 4.0 the postgresql DATABASE settings were changed to allow use
 of a .pg_service.conf and .pgpass file being defined in the OPTIONS value.

 Using the **old** config **works** fine in both runserver and test.

 Using the **new** config works for runserver but **fails** for test.

 In settings I have :-

 {{{#!python
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.postgresql',
         'OPTIONS': {
             'service': 'yfsm_pgdb',
             'passfile': '.yfsm_pgpass',
         },
     },
 }
 }}}

 I have the user password entry allowing login to any database (using `*`)
 I have also tried adding an entry with `test_dbname`. I also tried adding
 an entry in .pg_service.conf as `[test_yfsm_pgdb]`

 running tests I see `django.db.utils.OperationalError: fe_sendauth: no
 password supplied` indicating that the password file is not used.

 It would appear that when testing, the new OPTIONS settings are ignored.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33685>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180a28865d4-e0f8202c-f6ab-491a-b229-721ef039e3b0-000000%40eu-central-1.amazonses.com.

Reply via email to