Runs the pre-commit hooks over all the Python files

This commit is contained in:
Trenton Holmes
2022-03-11 10:55:51 -08:00
parent d3e9799279
commit 1771d18a21
94 changed files with 1638 additions and 991 deletions

View File

@@ -1,7 +1,7 @@
from django.core.management.base import CommandError
from django.test import TestCase
from documents.settings import EXPORTER_FILE_NAME
from ..management.commands.document_importer import Command
@@ -12,7 +12,9 @@ class TestImporter(TestCase):
def test_check_manifest_exists(self):
cmd = Command()
self.assertRaises(
CommandError, cmd._check_manifest_exists, "/tmp/manifest.json"
CommandError,
cmd._check_manifest_exists,
"/tmp/manifest.json",
)
def test_check_manifest(self):
@@ -26,11 +28,11 @@ class TestImporter(TestCase):
self.assertTrue("The manifest file contains a record" in str(cm.exception))
cmd.manifest = [
{"model": "documents.document", EXPORTER_FILE_NAME: "noexist.pdf"}
{"model": "documents.document", EXPORTER_FILE_NAME: "noexist.pdf"},
]
# self.assertRaises(CommandError, cmd._check_manifest)
with self.assertRaises(CommandError) as cm:
cmd._check_manifest()
self.assertTrue(
'The manifest file refers to "noexist.pdf"' in str(cm.exception)
'The manifest file refers to "noexist.pdf"' in str(cm.exception),
)