1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Allowed Python executable names other than python in test from refs #24007.

This commit is contained in:
Collin Anderson 2014-12-17 17:49:50 -05:00 committed by Tim Graham
parent 493ab45349
commit 4fb38b7307

View File

@ -1,6 +1,7 @@
import datetime import datetime
import pickle import pickle
import subprocess import subprocess
import sys
import tempfile import tempfile
import warnings import warnings
@ -82,7 +83,7 @@ print(article.headline)"""
script.write(script_template % pickle.dumps(a)) script.write(script_template % pickle.dumps(a))
script.flush() script.flush()
try: try:
result = subprocess.check_output(['python', script.name]) result = subprocess.check_output([sys.executable, script.name])
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
self.fail("Unable to reload model pickled data") self.fail("Unable to reload model pickled data")
self.assertEqual(result.strip().decode(), "Some object") self.assertEqual(result.strip().decode(), "Some object")