Lift code from django-nose to support django 1.5