mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-16 03:26:50 +01:00
feature: Add support for zxing as barcode scanning lib
This commit is contained in:
parent
7e75193f4a
commit
e89c0f15dd
7 changed files with 102 additions and 14 deletions
|
|
@ -3,6 +3,7 @@ import shutil
|
|||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from django.conf import settings
|
||||
from django.test import override_settings
|
||||
from django.test import TestCase
|
||||
|
|
@ -14,6 +15,7 @@ from documents.tests.utils import FileSystemAssertsMixin
|
|||
from PIL import Image
|
||||
|
||||
|
||||
@override_settings(CONSUMER_BARCODE_SCANNER="PYZBAR")
|
||||
class TestBarcode(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
|
||||
|
||||
SAMPLE_DIR = Path(__file__).parent / "samples"
|
||||
|
|
@ -1030,3 +1032,20 @@ class TestAsnBarcodes(DirectoriesMixin, TestCase):
|
|||
tasks.consume_file,
|
||||
dst,
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
import zxingcpp
|
||||
|
||||
ZXING_AVAILIBLE = True
|
||||
except ImportError:
|
||||
ZXING_AVAILIBLE = False
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not ZXING_AVAILIBLE,
|
||||
reason="No zxingcpp",
|
||||
)
|
||||
@override_settings(CONSUMER_BARCODE_SCANNER="ZXING")
|
||||
class TestBarcodeZxing(TestBarcode):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue