fixed tests
This commit is contained in:
parent
36fb1af01e
commit
2025d26a5c
@ -34,3 +34,6 @@ For the backend, install dependencies and run the server:
|
||||
pip install -r simple_chat_api/requirements.txt
|
||||
DEV=true python -m simple_chat_api
|
||||
```
|
||||
|
||||
To run tests:
|
||||
`python -m unittest discover -s simple_chat_api/tests -p "*.py"`
|
||||
|
||||
@ -185,10 +185,19 @@ class TestAuthEndpoints(unittest.TestCase):
|
||||
for user,session in self.userSessions.items():
|
||||
with self.subTest(user=user):
|
||||
pyload = {
|
||||
"new_password": "newadminpass"
|
||||
"old_password": users[user],
|
||||
"new_password": "newpass"
|
||||
}
|
||||
response = session.post(f"{API_URL}/user/changePassword/", json=pyload)
|
||||
self.assertEqual(response.status_code, 200, f"Admin failed to change password; {response.text}")
|
||||
response = session.post(f"{API_URL}/user/changePassword", json=pyload)
|
||||
self.assertEqual(response.status_code, 200, f"Failed to change password; {response.text}")
|
||||
|
||||
pyload = {
|
||||
"new_password": users[user],
|
||||
"old_password": "newpass"
|
||||
}
|
||||
response = session.post(f"{API_URL}/user/changePassword", json=pyload)
|
||||
self.assertEqual(response.status_code, 200, f"Failed to change passwords back; {response.text}")
|
||||
|
||||
|
||||
|
||||
class TestMessage(unittest.TestCase):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user