Add flatpages contrib to installed apps for tests
Fix PEP8 issues