Le jeudi 14 mai 2015 18:22:58 UTC+2, Carl Meyer a écrit :
>
> (...)
>
> I think the answer here is appropriate configurability. I see at least 
> two ways to make that happen: 
>
> 1) add a config OPTION to set what database is used when establishing a 
> "no-database" connection? The option would default to 'postgres', but 
> people who need to run tests against a provider who doesn't allow 
> connections to 'postgres' could set it to something else. 
>
> 2) Make it possible to specify an already-existing database to use for 
> running the tests, in such a way that Django won't try to create one or 
> tear it down, and thus won't need a no-db connection at all. 
>
> Carl 
>

Hi Carl,
I tried and proposed a patch with a third approach [1]: test the 'postgres' 
connection, catch database errors and fallback to the default database when 
the connection fails.
I guess that when no access is granted to the 'postgres' database, it's 
most probably that the user has only access to one database.
It wouldn't cost much to provide for an additional settings key, though, if 
needed.

Claude

[1] https://github.com/django/django/pull/4660

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7ee5b870-66f6-4f5f-b50e-63dbd7d2b6ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to