Make testsuite work inside Django

We need to tweak settings if they are already present.

Signed-off-by: Michal Čihař <michal@cihar.com>