Hi Claude, On 05/14/2015 12:42 PM, Claude Paroz wrote: > 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
That approach makes sense to me! I also don't see any use cases for options other than 'postgres' or 'main db', so just making it a simple fallback with warning seems reasonable enough. Carl -- 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/5554F898.6070504%40oddbird.net. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
