fix test cases

This commit is contained in:
jonaswinkler 2020-12-19 20:39:56 +01:00
parent bb814da95b
commit e79c45c98d
2 changed files with 3 additions and 7 deletions

View File

@ -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()

View File

@ -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."))