Correctly handle admin URL's with escaped pk's

Replaces https://github.com/treyhunner/django-simple-history/pull/84

It looks like this function is being called to sanitize values in URL's generated through the admin app:
https://github.com/django/django/blob/1.6.5/django/contrib/admin/util.py#L49

I added it to the function that generates the test URL's in the test module.