From 28ae1ab8d14f02aa89031a61ac021b40a1418f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Tue, 24 Sep 2019 14:03:55 +0300 Subject: [PATCH] Test reset password --- apps/account/tests/tests_web.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 apps/account/tests/tests_web.py diff --git a/apps/account/tests/tests_web.py b/apps/account/tests/tests_web.py new file mode 100644 index 00000000..33ba109f --- /dev/null +++ b/apps/account/tests/tests_web.py @@ -0,0 +1,24 @@ +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 + + +class AccountResetPassWordTests(APITestCase): + + def setUp(self): + self.data = get_tokens_for_user() + + def test_reset_password(self): + url = reverse('web:account:password-reset') + data = { + "username_or_email": self.data["email"] + } + response = self.client.post(url, data=data) + self.assertEqual(response.status_code, status.HTTP_200_OK) + + data = { + "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