Re: [Django] #33685: Tests crash when using only a service name on PostgreSQL. (was: Using new postgresql settings fails when running tests)

3 views
Skip to first unread message

Django

unread,
May 10, 2022, 1:04:56 AM5/10/22
to django-...@googlegroups.com
#33685: Tests crash when using only a service name on PostgreSQL.
-----------------------------------+------------------------------------
Reporter: Shane Ambler | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

> While you are maintaining both old and new config variations, all will
continue to work for you.
>
> If you remove the old, no longer documented, settings of `HOST` `PORT`
`NAME` `USER` then your setup will work for `runserver` but not `test`
> The pg docs [https://docs.djangoproject.com/en/4.0/ref/databases
/#postgresql-notes-1] only documents the new method of specifying
`service` and `passfile` in the `OPTIONS` ...

Using `['OPTIONS']['service']` and `['OPTIONS']['passfile']` is not a
"new" or only supported way for the `DATABASES` settings. It's a
PostgreSQL-specific option that you may use that's why it's documented
only in the ''"PostgreSQL notes"''. Using `HOST`, `PORT`, `NAME`, `USER`,
and `PASSWORD` is still fully supported for PostgreSQL, see
[https://docs.djangoproject.com/en/4.0/ref/settings/#databases docs].

> ... this documented setup **does not support running tests** with
postgresql databases.

`NAME` is used in many places for test setup, including cloning a test
database, that's why it doesn't work with only `service` specified.

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

Reply all
Reply to author
Forward
0 new messages