[1.6.x] Fixed 9244447c -- incomplete backport.
[1.6.x] Fixed 9244447c -- incomplete backport.

The test client had been refactored in the mean time. This commit
de-factors the fix. Refs #20530.

felixjimenez/django,django-nonrel/django,dex4er/django,felixjimenez/django,django-nonrel/django,redhat-openstack/django,redhat-openstack/django,redhat-openstack/django,dex4er/django,felixjimenez/django,redhat-openstack/django,django-nonrel/django,dex4er/django,django-nonrel/django,felixjimenez/django