mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 02:27:06 +01:00
Catch the new error raised by redis when it can't find the broker and stub out the call for testing
This commit is contained in:
parent
5aeb656a48
commit
8025df5fe3
2 changed files with 9 additions and 8 deletions
|
|
@ -397,7 +397,8 @@ class TestBarcode(DirectoriesMixin, TestCase):
|
|||
dst = os.path.join(settings.SCRATCH_DIR, "patch-code-t-middle.pdf")
|
||||
shutil.copy(test_file, dst)
|
||||
|
||||
self.assertEqual(tasks.consume_file(dst), "File successfully split")
|
||||
with mock.patch("documents.tasks.async_to_sync"):
|
||||
self.assertEqual(tasks.consume_file(dst), "File successfully split")
|
||||
|
||||
@override_settings(
|
||||
CONSUMER_ENABLE_BARCODES=True,
|
||||
|
|
@ -411,7 +412,8 @@ class TestBarcode(DirectoriesMixin, TestCase):
|
|||
dst = os.path.join(settings.SCRATCH_DIR, "patch-code-t-middle.tiff")
|
||||
shutil.copy(test_file, dst)
|
||||
|
||||
self.assertEqual(tasks.consume_file(dst), "File successfully split")
|
||||
with mock.patch("documents.tasks.async_to_sync"):
|
||||
self.assertEqual(tasks.consume_file(dst), "File successfully split")
|
||||
|
||||
@override_settings(
|
||||
CONSUMER_ENABLE_BARCODES=True,
|
||||
|
|
@ -465,4 +467,5 @@ class TestBarcode(DirectoriesMixin, TestCase):
|
|||
dst = os.path.join(settings.SCRATCH_DIR, "patch-code-t-middle")
|
||||
shutil.copy(test_file, dst)
|
||||
|
||||
self.assertEqual(tasks.consume_file(dst), "File successfully split")
|
||||
with mock.patch("documents.tasks.async_to_sync"):
|
||||
self.assertEqual(tasks.consume_file(dst), "File successfully split")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue