[1.8.x] Fixed #24717 -- Fixed model_regress test failure on RHEL6 SCL
[1.8.x] Fixed #24717 -- Fixed model_regress test failure on RHEL6 SCL

The test failed on RHEL6 systems running python 2.7 from a RedHat
Software Collection (SCL) because this test runs an external python
script with a stripped system environment. RedHat SCLs work by setting
a number of system environment variables when these are stripped out by
this test the python 2.7 interpreter is no longer able to function
properly because it can not find the system libraries needed.

Now we use use mock to modify the system environment directly.

Backport of 31e6c9c8e310e68a96c1f76b9657242c6cecaa4d from master

h4r5h1t/django-hauthy,pquentin/django,h4r5h1t/django-hauthy,h4r5h1t/django-hauthy,h4r5h1t/django-hauthy,pquentin/django,pquentin/django