make tests succeed on Django-1.7

This more tiny patch makes at least OpenStack Horizon work for me with Django 1.6 and 1.7. 
Also fixes tests on Django-1.6 and Django-1.7