--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
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/201401141904.43630.shai%40platonix.com.
For more options, visit https://groups.google.com/groups/opt_out.
+1, what Aymeric said.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANE-7mVYNJJiYJBdRAy17rgJV0hRh31fkd%3DMzF30kJOgoU3MMg%40mail.gmail.com.
The way testing currently works is by creating a throw-away database, running
the tests on that, and throwing it away. This means, among other things, that
you need settings for a database service and credentials for a user that can
create databases on this service. The common use-case is that this user is
your "main" database user, and the service is your main service. Your
suggestion, if I understand it correctly, gives the user two options:
1) Use separate credentials, and perhaps even a separate service, for testing;
this implies that the test database stays alive all the time.
2) Write configurations with repetitions or some other awkwardness, e.g.
default_db = {
'ENGINE': 'this',
'HOST': 'that',
'NAME': 'the_other',
'USER': 'me',
'PASSWORD': 'my secret',
}
DATABASES = {
'default' : default_db,
'test_default' : dict(default_db,
NAME='test_the_other',
IS_TEST=True),
}
I don't see that as an improvement; you seem to be optimizing for the edge
case at the expense of the common case.