From e79c45c98d5164de4c99888c1a9cbd7553ab3bcc Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Sat, 19 Dec 2020 20:39:56 +0100 Subject: [PATCH] fix test cases --- src/paperless/checks.py | 7 ++----- src/paperless/tests/test_checks.py | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/paperless/checks.py b/src/paperless/checks.py index 3e26ae69f..1e74b30a9 100644 --- a/src/paperless/checks.py +++ b/src/paperless/checks.py @@ -36,12 +36,9 @@ def paths_check(app_configs, **kwargs): Check the various paths for existence, readability and writeability """ - check_messages = path_check("PAPERLESS_DATA_DIR", settings.DATA_DIR) + \ + return path_check("PAPERLESS_DATA_DIR", settings.DATA_DIR) + \ path_check("PAPERLESS_MEDIA_ROOT", settings.MEDIA_ROOT) + \ - path_check("PAPERLESS_CONSUMPTION_DIR", settings.CONSUMPTION_DIR) + \ - path_check("PAPERLESS_STATICDIR", settings.STATIC_ROOT) - - return check_messages + path_check("PAPERLESS_CONSUMPTION_DIR", settings.CONSUMPTION_DIR) @register() diff --git a/src/paperless/tests/test_checks.py b/src/paperless/tests/test_checks.py index 61cc05bf0..e1525cab8 100644 --- a/src/paperless/tests/test_checks.py +++ b/src/paperless/tests/test_checks.py @@ -21,12 +21,11 @@ class TestChecks(DirectoriesMixin, TestCase): self.assertEqual(paths_check(None), []) @override_settings(MEDIA_ROOT="uuh", - STATIC_ROOT="somewhere", DATA_DIR="whatever", CONSUMPTION_DIR="idontcare") def test_paths_check_dont_exist(self): msgs = paths_check(None) - self.assertEqual(len(msgs), 4) + self.assertEqual(len(msgs), 3, str(msgs)) for msg in msgs: self.assertTrue(msg.msg.endswith("is set but doesn't exist."))