Django 1.5/Python 3 compatibility; fixed tests