diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 1e5b0c6ad1b..d48a0c8071c 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