Initialize Django before running the tests.

This became necessary with Django-1.7, see:
https://docs.djangoproject.com/en/dev/releases/1.7/#standalone-scripts
Only use django.setup() for Django >= 1.7.