mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Add tests for checks.py
This commit is contained in:
parent
20891a370b
commit
d5f46eedab
@ -105,6 +105,42 @@ class TestSettingsChecks(DirectoriesMixin, TestCase):
|
|||||||
|
|
||||||
self.assertIn('OCR output mode "makeitso"', msg.msg)
|
self.assertIn('OCR output mode "makeitso"', msg.msg)
|
||||||
|
|
||||||
|
@override_settings(OCR_MODE="skip_noarchive")
|
||||||
|
def test_deprecated_ocr_type(self):
|
||||||
|
"""
|
||||||
|
GIVEN:
|
||||||
|
- Default settings
|
||||||
|
- OCR type is deprecated
|
||||||
|
WHEN:
|
||||||
|
- Settings are validated
|
||||||
|
THEN:
|
||||||
|
- deprecation warning reported for OCR type
|
||||||
|
"""
|
||||||
|
msgs = settings_values_check(None)
|
||||||
|
self.assertEqual(len(msgs), 1)
|
||||||
|
|
||||||
|
msg = msgs[0]
|
||||||
|
|
||||||
|
self.assertIn("deprecated", msg.msg)
|
||||||
|
|
||||||
|
@override_settings(OCR_SKIP_ARCHIVE_FILE="invalid")
|
||||||
|
def test_invalid_ocr_skip_archive_file(self):
|
||||||
|
"""
|
||||||
|
GIVEN:
|
||||||
|
- Default settings
|
||||||
|
- OCR_SKIP_ARCHIVE_FILE is invalid
|
||||||
|
WHEN:
|
||||||
|
- Settings are validated
|
||||||
|
THEN:
|
||||||
|
- system check error reported for OCR_SKIP_ARCHIVE_FILE
|
||||||
|
"""
|
||||||
|
msgs = settings_values_check(None)
|
||||||
|
self.assertEqual(len(msgs), 1)
|
||||||
|
|
||||||
|
msg = msgs[0]
|
||||||
|
|
||||||
|
self.assertIn('OCR_SKIP_ARCHIVE_FILE setting "invalid"', msg.msg)
|
||||||
|
|
||||||
@override_settings(OCR_CLEAN="cleanme")
|
@override_settings(OCR_CLEAN="cleanme")
|
||||||
def test_invalid_ocr_clean(self):
|
def test_invalid_ocr_clean(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user