mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-12 09:37:04 +01:00
Fixes the seperation of files by barcode, during the case where 2 barcodes appear back to back
This commit is contained in:
parent
17ae2aacbf
commit
9ae847039b
3 changed files with 62 additions and 32 deletions
BIN
src/documents/tests/samples/barcodes/patch-code-t-double.pdf
Normal file
BIN
src/documents/tests/samples/barcodes/patch-code-t-double.pdf
Normal file
Binary file not shown.
|
|
@ -287,6 +287,26 @@ class TestBarcode(DirectoriesMixin, TestCase):
|
|||
"patch-code-t-middle.pdf",
|
||||
)
|
||||
pages = barcodes.separate_pages(test_file, [1])
|
||||
|
||||
self.assertEqual(len(pages), 2)
|
||||
|
||||
def test_separate_pages_double_code(self):
|
||||
"""
|
||||
GIVEN:
|
||||
- Input PDF with two patch code pages in a row
|
||||
WHEN:
|
||||
- The input file is split
|
||||
THEN:
|
||||
- Only two files are output
|
||||
"""
|
||||
test_file = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"samples",
|
||||
"barcodes",
|
||||
"patch-code-t-double.pdf",
|
||||
)
|
||||
pages = barcodes.separate_pages(test_file, [1, 2])
|
||||
|
||||
self.assertEqual(len(pages), 2)
|
||||
|
||||
def test_separate_pages_no_list(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue