1
0
mirror of https://github.com/django/django.git synced 2025-01-12 03:15:47 +00:00

Made model_regress unpickling test CWD-independent

Refs . Thanks Tim Graham for his help with the patch.
This commit is contained in:
Claude Paroz 2014-12-18 21:39:15 +01:00
parent 337cd09836
commit 1d9fc5caa9

View File

@ -83,7 +83,10 @@ print(article.headline)"""
script.write(script_template % pickle.dumps(a))
script.flush()
try:
result = subprocess.check_output([sys.executable, script.name])
result = subprocess.check_output(
[sys.executable, script.name],
env={'PYTHONPATH': ':'.join(sys.path)}
)
except subprocess.CalledProcessError:
self.fail("Unable to reload model pickled data")
self.assertEqual(result.strip().decode(), "Some object")