Use literals in place of HTTPStatus constants in tests (#13479)

Replace
- `HTTPStatus.NOT_FOUND`
- `HTTPStatus.FORBIDDEN`
- `HTTPStatus.UNAUTHORIZED`
- `HTTPStatus.CONFLICT`
- `HTTPStatus.CREATED`

Signed-off-by: Dirk Klimpel <dirk@klimpel.org>
This commit is contained in:
Dirk Klimpel 2022-08-09 15:56:43 +02:00 committed by GitHub
parent 54fb517c28
commit 1595052b26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 141 additions and 141 deletions

View file

@ -52,7 +52,7 @@ class UserMediaStatisticsTestCase(unittest.HomeserverTestCase):
channel = self.make_request("GET", self.url, b"{}")
self.assertEqual(
HTTPStatus.UNAUTHORIZED,
401,
channel.code,
msg=channel.json_body,
)
@ -60,7 +60,7 @@ class UserMediaStatisticsTestCase(unittest.HomeserverTestCase):
def test_requester_is_no_admin(self) -> None:
"""
If the user is not a server admin, an error HTTPStatus.FORBIDDEN is returned.
If the user is not a server admin, an error 403 is returned.
"""
channel = self.make_request(
"GET",
@ -70,7 +70,7 @@ class UserMediaStatisticsTestCase(unittest.HomeserverTestCase):
)
self.assertEqual(
HTTPStatus.FORBIDDEN,
403,
channel.code,
msg=channel.json_body,
)