Refactor file copy to use Path instead of os.path.join
This commit is contained in:
parent
a9f6e054c1
commit
a85d6cdc38
@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
@ -26,7 +27,7 @@ class TestMigrateDocumentPagesCount(TestMigrations):
|
|||||||
)
|
)
|
||||||
self.doc_id = doc.id
|
self.doc_id = doc.id
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
os.path.join(os.path.dirname(__file__), "samples", "simple.pdf"),
|
Path(__file__).parent / "samples" / "simple.pdf",
|
||||||
source_path_before(doc),
|
source_path_before(doc),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user