mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 23:35:22 +01:00
fixed test case.
This commit is contained in:
parent
84e3bfad95
commit
bd322a0ce6
1 changed files with 4 additions and 1 deletions
|
|
@ -450,12 +450,14 @@ class TestConsumer(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.scratch_dir = tempfile.mkdtemp()
|
self.scratch_dir = tempfile.mkdtemp()
|
||||||
self.media_dir = tempfile.mkdtemp()
|
self.media_dir = tempfile.mkdtemp()
|
||||||
|
self.consumption_dir = tempfile.mkdtemp()
|
||||||
|
|
||||||
override_settings(
|
override_settings(
|
||||||
SCRATCH_DIR=self.scratch_dir,
|
SCRATCH_DIR=self.scratch_dir,
|
||||||
MEDIA_ROOT=self.media_dir,
|
MEDIA_ROOT=self.media_dir,
|
||||||
ORIGINALS_DIR=os.path.join(self.media_dir, "documents", "originals"),
|
ORIGINALS_DIR=os.path.join(self.media_dir, "documents", "originals"),
|
||||||
THUMBNAIL_DIR=os.path.join(self.media_dir, "documents", "thumbnails")
|
THUMBNAIL_DIR=os.path.join(self.media_dir, "documents", "thumbnails"),
|
||||||
|
CONSUMPTION_DIR=self.consumption_dir
|
||||||
).enable()
|
).enable()
|
||||||
|
|
||||||
patcher = mock.patch("documents.parsers.document_consumer_declaration.send")
|
patcher = mock.patch("documents.parsers.document_consumer_declaration.send")
|
||||||
|
|
@ -473,6 +475,7 @@ class TestConsumer(TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
shutil.rmtree(self.scratch_dir, ignore_errors=True)
|
shutil.rmtree(self.scratch_dir, ignore_errors=True)
|
||||||
shutil.rmtree(self.media_dir, ignore_errors=True)
|
shutil.rmtree(self.media_dir, ignore_errors=True)
|
||||||
|
shutil.rmtree(self.consumption_dir, ignore_errors=True)
|
||||||
|
|
||||||
def get_test_file(self):
|
def get_test_file(self):
|
||||||
fd, f = tempfile.mkstemp(suffix=".pdf", dir=self.scratch_dir)
|
fd, f = tempfile.mkstemp(suffix=".pdf", dir=self.scratch_dir)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue