mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-14 00:26:21 +00:00
Ensure all creations of directories create the parents too (#5711)
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import datetime
|
||||
import os
|
||||
import shutil
|
||||
from uuid import uuid4
|
||||
|
||||
from dateutil import tz
|
||||
from django.conf import settings
|
||||
@@ -13,17 +10,6 @@ from documents.parsers import parse_date_generator
|
||||
|
||||
|
||||
class TestDate(TestCase):
|
||||
SAMPLE_FILES = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"../../paperless_tesseract/tests/samples",
|
||||
)
|
||||
SCRATCH = f"/tmp/paperless-tests-{str(uuid4())[:8]}"
|
||||
|
||||
def setUp(self):
|
||||
os.makedirs(self.SCRATCH, exist_ok=True)
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.SCRATCH)
|
||||
|
||||
def test_date_format_1(self):
|
||||
text = "lorem ipsum 130218 lorem ipsum"
|
||||
@@ -93,7 +79,6 @@ class TestDate(TestCase):
|
||||
datetime.datetime(2020, 3, 1, 0, 0, tzinfo=tz.gettz(settings.TIME_ZONE)),
|
||||
)
|
||||
|
||||
@override_settings(SCRATCH_DIR=SCRATCH)
|
||||
def test_date_format_9(self):
|
||||
text = "lorem ipsum\n27. Nullmonth 2020\nMärz 2020\nlorem ipsum"
|
||||
self.assertEqual(
|
||||
|
Reference in New Issue
Block a user