add test confirm email

This commit is contained in:
Виктор Гладких 2019-09-23 18:01:06 +03:00
parent 70f9100813
commit 22c237c3d7

View File

@ -2,6 +2,8 @@ from rest_framework.test import APITestCase
from rest_framework import status
from authorization.tests.tests import get_tokens_for_user
from http.cookies import SimpleCookie
from account.models import User
from os import path
# Create your tests here.
@ -49,7 +51,7 @@ class AccountChangePasswordTests(APITestCase):
def test_change_password(self):
data = {
"old_password" : self.data["password"],
"old_password": self.data["password"],
"password": "new password"
}
@ -64,4 +66,15 @@ class AccountChangePasswordTests(APITestCase):
self.assertEqual(response.status_code, status.HTTP_200_OK)
class AccountChangePasswordTests(APITestCase):
# "/web/account/email/confirm/{uidb64}/{token}/"
url = "/web/account/email/confirm/"
def setUp(self):
self.data = get_tokens_for_user()
def test_confirm_email(self):
user = User.objects.get(email=self.data["email"])
token = user.confirm_email_token
uid64 = user.get_user_uidb64
url = path.join(self.url, uid64, token, "")