fix for settings.DEBUG being reset when test flag is used

settings.DEBUG is reset when the test database setup (turned on with -T) is set.

Moving this below the conditional statements solves that problem.