Fixing tests for various Python and Django versions