mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-10 16:46:50 +01:00
Updates the latest test to use status codes
This commit is contained in:
parent
a6e2708605
commit
8df1324afd
2 changed files with 5 additions and 9 deletions
|
|
@ -1331,7 +1331,7 @@ class TestDocumentApi(DirectoriesMixin, APITestCase):
|
|||
{"document": f, "archive_serial_number": 500},
|
||||
)
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
|
||||
m.assert_called_once()
|
||||
|
||||
|
|
|
|||
|
|
@ -92,20 +92,16 @@ class DirectoriesMixin:
|
|||
|
||||
class FileSystemAssertsMixin:
|
||||
def assertIsFile(self, path: Union[PathLike, str]):
|
||||
if not Path(path).resolve().is_file():
|
||||
raise AssertionError(f"File does not exist: {path}")
|
||||
self.assertTrue(Path(path).resolve().is_file(), f"File does not exist: {path}")
|
||||
|
||||
def assertIsNotFile(self, path: Union[PathLike, str]):
|
||||
if Path(path).resolve().is_file():
|
||||
raise AssertionError(f"File does exist: {path}")
|
||||
self.assertFalse(Path(path).resolve().is_file(), f"File does exist: {path}")
|
||||
|
||||
def assertIsDir(self, path: Union[PathLike, str]):
|
||||
if not Path(path).resolve().is_dir():
|
||||
raise AssertionError(f"Dir does not exist: {path}")
|
||||
self.assertTrue(Path(path).resolve().is_dir(), f"Dir does not exist: {path}")
|
||||
|
||||
def assertIsNotDir(self, path: Union[PathLike, str]):
|
||||
if Path(path).resolve().is_dir():
|
||||
raise AssertionError(f"Dir does exist: {path}")
|
||||
self.assertFalse(Path(path).resolve().is_dir(), f"Dir does exist: {path}")
|
||||
|
||||
|
||||
class ConsumerProgressMixin:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue