Add test for change-password
This commit is contained in:
parent
31f6c2c53a
commit
70f9100813
|
|
@ -49,11 +49,19 @@ class AccountChangePasswordTests(APITestCase):
|
|||
|
||||
def test_change_password(self):
|
||||
data = {
|
||||
"old_password" : self.data["password"],
|
||||
"password": "new password"
|
||||
}
|
||||
|
||||
response = self.client.patch(self.url, data=data, format='json')
|
||||
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
self.client.cookies = SimpleCookie(
|
||||
{'access_token': self.data['tokens'].get('access_token'),
|
||||
'refresh_token': self.data['tokens'].get('access_token')})
|
||||
|
||||
response = self.client.patch(self.url, data=data, format='json')
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user