summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2019-02-14 14:28:19 +0100
committerGitHub <noreply@github.com>2019-02-14 14:28:19 +0100
commited7dee55a94b7243bc2757fd88055a1c7a87a79d (patch)
tree43a4017f0a0110463ac0b6eb2c7a17114622ca3e /tests/admin_scripts
parentcf826c9a91015c8da2ad4910b12e2ed83e2fb20f (diff)
downloaddjango-ed7dee55a94b7243bc2757fd88055a1c7a87a79d.tar.gz
Fixed admin_scripts test failures on macOS.
Regression in 487d904bf253de2f5633f181a168f94086bcd6cb.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 1e5b0c6ad1..d48a0c8071 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -42,7 +42,9 @@ class AdminScriptTestCase(SimpleTestCase):
def setUp(self):
tmpdir = tempfile.TemporaryDirectory()
self.addCleanup(tmpdir.cleanup)
- self.test_dir = os.path.join(tmpdir.name, 'test_project')
+ # os.path.realpath() is required for temporary directories on macOS,
+ # where `/var` is a symlink to `/private/var`.
+ self.test_dir = os.path.realpath(os.path.join(tmpdir.name, 'test_project'))
os.mkdir(self.test_dir)
with open(os.path.join(self.test_dir, '__init__.py'), 'w'):
pass