diff --git a/apps/account/tests/tests_web.py b/apps/account/tests/tests_web.py index 33ba109f..e771b31a 100644 --- a/apps/account/tests/tests_web.py +++ b/apps/account/tests/tests_web.py @@ -2,6 +2,7 @@ from rest_framework.test import APITestCase from rest_framework import status from authorization.tests.tests import get_tokens_for_user from django.urls import reverse +from account.models import User class AccountResetPassWordTests(APITestCase): @@ -21,4 +22,28 @@ class AccountResetPassWordTests(APITestCase): "username_or_email": self.data["username"] } response = self.client.post(url, data=data) - self.assertEqual(response.status_code, status.HTTP_200_OK) \ No newline at end of file + self.assertEqual(response.status_code, status.HTTP_200_OK) + + +class AccountResetPassWordTests(APITestCase): + + def setUp(self): + self.data = get_tokens_for_user() + + def test_reset_password_confirm(self): + data ={ + "password": "newpasswordnewpassword" + } + user = User.objects.get(email=self.data["email"]) + token = user.reset_password_token + uidb64 = user.get_user_uidb64 + + url = reverse('web:account:password-reset-confirm', kwargs={ + 'uidb64': uidb64, + 'token': token + }) + response = self.client.patch(url, data=data) + self.assertEqual(response.status_code, status.HTTP_200_OK) + + +