mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-09-19 08:07:58 +00:00
Chore(mypy): Annotate None returns for typing improvements (#11213)
This commit is contained in:
@@ -21,7 +21,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
)
|
||||
return out.getvalue()
|
||||
|
||||
def test_no_user(self):
|
||||
def test_no_user(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Environment does not contain admin user info
|
||||
@@ -40,7 +40,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
"Please check if PAPERLESS_ADMIN_PASSWORD has been set in the environment\n",
|
||||
)
|
||||
|
||||
def test_create(self):
|
||||
def test_create(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Environment does contain admin user password
|
||||
@@ -58,7 +58,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
self.assertEqual(user.email, "root@localhost")
|
||||
self.assertEqual(out, 'Created superuser "admin" with provided password.\n')
|
||||
|
||||
def test_some_superuser_exists(self):
|
||||
def test_some_superuser_exists(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A super user already exists
|
||||
@@ -78,7 +78,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
"Did not create superuser, the DB already contains superusers\n",
|
||||
)
|
||||
|
||||
def test_admin_superuser_exists(self):
|
||||
def test_admin_superuser_exists(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A super user already exists
|
||||
@@ -96,7 +96,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
self.assertTrue(user.check_password("password"))
|
||||
self.assertEqual(out, "Did not create superuser, a user admin already exists\n")
|
||||
|
||||
def test_admin_user_exists(self):
|
||||
def test_admin_user_exists(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A user already exists with the username admin
|
||||
@@ -116,7 +116,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
self.assertFalse(user.is_superuser)
|
||||
self.assertEqual(out, "Did not create superuser, a user admin already exists\n")
|
||||
|
||||
def test_no_password(self):
|
||||
def test_no_password(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- No environment data is set
|
||||
@@ -132,7 +132,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
"Please check if PAPERLESS_ADMIN_PASSWORD has been set in the environment\n",
|
||||
)
|
||||
|
||||
def test_user_email(self):
|
||||
def test_user_email(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Environment does contain admin user password
|
||||
@@ -155,7 +155,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
self.assertEqual(user.username, "admin")
|
||||
self.assertEqual(out, 'Created superuser "admin" with provided password.\n')
|
||||
|
||||
def test_user_username(self):
|
||||
def test_user_username(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Environment does contain admin user password
|
||||
|
||||
Reference in New Issue
Block a user