mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-12 00:19:48 +00:00
Fix consumer declaration file extensions
This commit is contained in:
@@ -43,17 +43,17 @@ class RemoteDocumentParser(RasterisedDocumentParser):
|
|||||||
|
|
||||||
def supported_mime_types(self):
|
def supported_mime_types(self):
|
||||||
if self.settings.engine_is_valid():
|
if self.settings.engine_is_valid():
|
||||||
return [
|
return {
|
||||||
"application/pdf",
|
"application/pdf": ".pdf",
|
||||||
"image/png",
|
"image/png": ".png",
|
||||||
"image/jpeg",
|
"image/jpeg": ".jpg",
|
||||||
"image/tiff",
|
"image/tiff": ".tiff",
|
||||||
"image/bmp",
|
"image/bmp": ".bmp",
|
||||||
"image/gif",
|
"image/gif": ".gif",
|
||||||
"image/webp",
|
"image/webp": ".webp",
|
||||||
]
|
}
|
||||||
else:
|
else:
|
||||||
return []
|
return {}
|
||||||
|
|
||||||
def azure_ai_vision_parse(
|
def azure_ai_vision_parse(
|
||||||
self,
|
self,
|
||||||
|
@@ -75,20 +75,20 @@ class TestParser(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
|
|||||||
)
|
)
|
||||||
def test_supported_mime_types_valid_config(self):
|
def test_supported_mime_types_valid_config(self):
|
||||||
parser = RemoteDocumentParser(uuid.uuid4())
|
parser = RemoteDocumentParser(uuid.uuid4())
|
||||||
expected_types = [
|
expected_types = {
|
||||||
"application/pdf",
|
"application/pdf": ".pdf",
|
||||||
"image/png",
|
"image/png": ".png",
|
||||||
"image/jpeg",
|
"image/jpeg": ".jpg",
|
||||||
"image/tiff",
|
"image/tiff": ".tiff",
|
||||||
"image/bmp",
|
"image/bmp": ".bmp",
|
||||||
"image/gif",
|
"image/gif": ".gif",
|
||||||
"image/webp",
|
"image/webp": ".webp",
|
||||||
]
|
}
|
||||||
self.assertEqual(parser.supported_mime_types(), expected_types)
|
self.assertEqual(parser.supported_mime_types(), expected_types)
|
||||||
|
|
||||||
def test_supported_mime_types_invalid_config(self):
|
def test_supported_mime_types_invalid_config(self):
|
||||||
parser = get_parser(uuid.uuid4())
|
parser = get_parser(uuid.uuid4())
|
||||||
self.assertEqual(parser.supported_mime_types(), [])
|
self.assertEqual(parser.supported_mime_types(), {})
|
||||||
|
|
||||||
@override_settings(
|
@override_settings(
|
||||||
REMOTE_OCR_ENGINE=None,
|
REMOTE_OCR_ENGINE=None,
|
||||||
|
Reference in New Issue
Block a user