Use pathlib
This commit is contained in:
parent
8c26b09177
commit
45c27dbc0b
@ -285,57 +285,47 @@ class TestPDFActions(DirectoriesMixin, TestCase):
|
|||||||
super().setUp()
|
super().setUp()
|
||||||
sample1 = os.path.join(self.dirs.scratch_dir, "sample.pdf")
|
sample1 = os.path.join(self.dirs.scratch_dir, "sample.pdf")
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
os.path.join(
|
Path(__file__).parent
|
||||||
os.path.dirname(__file__),
|
/ "samples"
|
||||||
"samples",
|
/ "documents"
|
||||||
"documents",
|
/ "originals"
|
||||||
"originals",
|
/ "0000001.pdf",
|
||||||
"0000001.pdf",
|
|
||||||
),
|
|
||||||
sample1,
|
sample1,
|
||||||
)
|
)
|
||||||
sample1_archive = os.path.join(self.dirs.archive_dir, "sample_archive.pdf")
|
sample1_archive = os.path.join(self.dirs.archive_dir, "sample_archive.pdf")
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
os.path.join(
|
Path(__file__).parent
|
||||||
os.path.dirname(__file__),
|
/ "samples"
|
||||||
"samples",
|
/ "documents"
|
||||||
"documents",
|
/ "originals"
|
||||||
"originals",
|
/ "0000001.pdf",
|
||||||
"0000001.pdf",
|
|
||||||
),
|
|
||||||
sample1_archive,
|
sample1_archive,
|
||||||
)
|
)
|
||||||
sample2 = os.path.join(self.dirs.scratch_dir, "sample2.pdf")
|
sample2 = os.path.join(self.dirs.scratch_dir, "sample2.pdf")
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
os.path.join(
|
Path(__file__).parent
|
||||||
os.path.dirname(__file__),
|
/ "samples"
|
||||||
"samples",
|
/ "documents"
|
||||||
"documents",
|
/ "originals"
|
||||||
"originals",
|
/ "0000002.pdf",
|
||||||
"0000002.pdf",
|
|
||||||
),
|
|
||||||
sample2,
|
sample2,
|
||||||
)
|
)
|
||||||
sample2_archive = os.path.join(self.dirs.archive_dir, "sample2_archive.pdf")
|
sample2_archive = os.path.join(self.dirs.archive_dir, "sample2_archive.pdf")
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
os.path.join(
|
Path(__file__).parent
|
||||||
os.path.dirname(__file__),
|
/ "samples"
|
||||||
"samples",
|
/ "documents"
|
||||||
"documents",
|
/ "originals"
|
||||||
"originals",
|
/ "0000002.pdf",
|
||||||
"0000002.pdf",
|
|
||||||
),
|
|
||||||
sample2_archive,
|
sample2_archive,
|
||||||
)
|
)
|
||||||
sample3 = os.path.join(self.dirs.scratch_dir, "sample3.pdf")
|
sample3 = os.path.join(self.dirs.scratch_dir, "sample3.pdf")
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
os.path.join(
|
Path(__file__).parent
|
||||||
os.path.dirname(__file__),
|
/ "samples"
|
||||||
"samples",
|
/ "documents"
|
||||||
"documents",
|
/ "originals"
|
||||||
"originals",
|
/ "0000003.pdf",
|
||||||
"0000003.pdf",
|
|
||||||
),
|
|
||||||
sample3,
|
sample3,
|
||||||
)
|
)
|
||||||
self.doc1 = Document.objects.create(checksum="A", title="A", filename=sample1)
|
self.doc1 = Document.objects.create(checksum="A", title="A", filename=sample1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user