mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Allowed Python executable names other than python in test from refs #24007.
This commit is contained in:
parent
493ab45349
commit
4fb38b7307
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user