Add compatibility for unittests in Django 1.6