Add tests using django settings

Fix some issues and add more and more tests. Yay more tests.