diff --git a/src/documents/tests/utils.py b/src/documents/tests/utils.py index d2a1724db..b1deac021 100644 --- a/src/documents/tests/utils.py +++ b/src/documents/tests/utils.py @@ -35,7 +35,7 @@ def setup_directories(): dirs.scratch_dir = Path(tempfile.mkdtemp()) dirs.media_dir = Path(tempfile.mkdtemp()) dirs.consumption_dir = Path(tempfile.mkdtemp()) - dirs.consumption_failed_dir = dirs.consumption_dir / "failed" + dirs.consumption_failed_dir = Path(tempfile.mkdtemp("failed")) dirs.static_dir = Path(tempfile.mkdtemp()) dirs.index_dir = dirs.data_dir / "index" dirs.originals_dir = dirs.media_dir / "documents" / "originals" diff --git a/src/paperless/tests/test_checks.py b/src/paperless/tests/test_checks.py index d2ea9102b..548b1d371 100644 --- a/src/paperless/tests/test_checks.py +++ b/src/paperless/tests/test_checks.py @@ -29,10 +29,11 @@ class TestChecks(DirectoriesMixin, TestCase): MEDIA_ROOT="uuh", DATA_DIR="whatever", CONSUMPTION_DIR="idontcare", + CONSUMPTION_FAILED_DIR="nope", ) def test_paths_check_dont_exist(self): msgs = paths_check(None) - self.assertEqual(len(msgs), 3, str(msgs)) + self.assertEqual(len(msgs), 4, str(msgs)) for msg in msgs: self.assertTrue(msg.msg.endswith("is set but doesn't exist.")) @@ -41,13 +42,15 @@ class TestChecks(DirectoriesMixin, TestCase): os.chmod(self.dirs.data_dir, 0o000) os.chmod(self.dirs.media_dir, 0o000) os.chmod(self.dirs.consumption_dir, 0o000) + os.chmod(self.dirs.consumption_failed_dir, 0o000) self.addCleanup(os.chmod, self.dirs.data_dir, 0o777) self.addCleanup(os.chmod, self.dirs.media_dir, 0o777) self.addCleanup(os.chmod, self.dirs.consumption_dir, 0o777) + self.addCleanup(os.chmod, self.dirs.consumption_failed_dir, 0o777) msgs = paths_check(None) - self.assertEqual(len(msgs), 3) + self.assertEqual(len(msgs), 4) for msg in msgs: self.assertTrue(msg.msg.endswith("is not writeable"))