mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-12 01:26:47 +01:00
Minor tweak to password test to ensure the right lines were hit
This commit is contained in:
parent
4fce5aba63
commit
9784ea4a60
1 changed files with 8 additions and 3 deletions
|
|
@ -845,9 +845,14 @@ class TestBarcode(DirectoriesMixin, TestCase):
|
||||||
- Scanning handles the exception without crashing
|
- Scanning handles the exception without crashing
|
||||||
"""
|
"""
|
||||||
test_file = os.path.join(self.SAMPLE_DIR, "password-is-test.pdf")
|
test_file = os.path.join(self.SAMPLE_DIR, "password-is-test.pdf")
|
||||||
|
with self.assertLogs("paperless.barcodes", level="WARNING") as cm:
|
||||||
doc_barcode_info = barcodes.scan_file_for_barcodes(
|
doc_barcode_info = barcodes.scan_file_for_barcodes(
|
||||||
test_file,
|
test_file,
|
||||||
)
|
)
|
||||||
|
warning = cm.output[0]
|
||||||
|
expected_str = "WARNING:paperless.barcodes:File is likely password protected, not checking for barcodes"
|
||||||
|
self.assertTrue(warning.startswith(expected_str))
|
||||||
|
|
||||||
separator_page_numbers = barcodes.get_separating_barcodes(
|
separator_page_numbers = barcodes.get_separating_barcodes(
|
||||||
doc_barcode_info.barcodes,
|
doc_barcode_info.barcodes,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue