stages/prompt: add prompt stage: dynamically created forms based on database
This commit is contained in:
@ -5,7 +5,6 @@ from random import SystemRandom
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
|
||||
from passbook.core.forms.authentication import SignUpForm
|
||||
from passbook.core.models import User
|
||||
|
||||
|
||||
@ -33,12 +32,6 @@ class TestAuthenticationViews(TestCase):
|
||||
),
|
||||
)
|
||||
|
||||
def test_sign_up_view(self):
|
||||
"""Test account.sign_up view (Anonymous)"""
|
||||
self.client.logout()
|
||||
response = self.client.get(reverse("passbook_core:auth-sign-up"))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_logout_view(self):
|
||||
"""Test account.logout view"""
|
||||
self.client.force_login(self.user)
|
||||
@ -50,81 +43,3 @@ class TestAuthenticationViews(TestCase):
|
||||
self.client.force_login(self.user)
|
||||
response = self.client.get(reverse("passbook_core:auth-logout"))
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
def test_sign_up_view_post(self):
|
||||
"""Test account.sign_up view POST (Anonymous)"""
|
||||
form = SignUpForm(self.sign_up_data)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
response = self.client.post(
|
||||
reverse("passbook_core:auth-sign-up"), data=form.cleaned_data
|
||||
)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
# def test_reset_password_init_view(self):
|
||||
# """Test account.reset_password_init view POST (Anonymous)"""
|
||||
# form = SignUpForm(self.sign_up_data)
|
||||
# self.assertTrue(form.is_valid())
|
||||
|
||||
# res = test_request(accounts.SignUpView.as_view(),
|
||||
# method='POST',
|
||||
# req_kwargs=form.cleaned_data)
|
||||
# self.assertEqual(res.status_code, 302)
|
||||
|
||||
# res = test_request(accounts.PasswordResetInitView.as_view())
|
||||
# self.assertEqual(res.status_code, 200)
|
||||
|
||||
# def test_resend_confirmation(self):
|
||||
# """Test AccountController.resend_confirmation"""
|
||||
# form = SignUpForm(self.sign_up_data)
|
||||
# self.assertTrue(form.is_valid())
|
||||
|
||||
# res = test_request(accounts.SignUpView.as_view(),
|
||||
# method='POST',
|
||||
# req_kwargs=form.cleaned_data)
|
||||
# self.assertEqual(res.status_code, 302)
|
||||
# user = User.objects.get(email=self.sign_up_data['email'])
|
||||
# # Invalidate all other links for this user
|
||||
# old_acs = AccountConfirmation.objects.filter(
|
||||
# user=user)
|
||||
# for old_ac in old_acs:
|
||||
# old_ac.confirmed = True
|
||||
# old_ac.save()
|
||||
# # Create Account Confirmation UUID
|
||||
# new_ac = AccountConfirmation.objects.create(user=user)
|
||||
# self.assertFalse(new_ac.is_expired)
|
||||
# on_user_confirm_resend.send(
|
||||
# sender=None,
|
||||
# user=user,
|
||||
# request=None)
|
||||
|
||||
# def test_reset_passowrd(self):
|
||||
# """Test reset password POST"""
|
||||
# # Signup user first
|
||||
# sign_up_form = SignUpForm(self.sign_up_data)
|
||||
# self.assertTrue(sign_up_form.is_valid())
|
||||
|
||||
# sign_up_res = test_request(accounts.SignUpView.as_view(),
|
||||
# method='POST',
|
||||
# req_kwargs=sign_up_form.cleaned_data)
|
||||
# self.assertEqual(sign_up_res.status_code, 302)
|
||||
|
||||
# user = User.objects.get(email=self.sign_up_data['email'])
|
||||
# # Invalidate all other links for this user
|
||||
# old_acs = AccountConfirmation.objects.filter(
|
||||
# user=user)
|
||||
# for old_ac in old_acs:
|
||||
# old_ac.confirmed = True
|
||||
# old_ac.save()
|
||||
# # Create Account Confirmation UUID
|
||||
# new_ac = AccountConfirmation.objects.create(user=user)
|
||||
# self.assertFalse(new_ac.is_expired)
|
||||
# uuid = AccountConfirmation.objects.filter(user=user).first().pk
|
||||
# reset_res = test_request(accounts.PasswordResetFinishView.as_view(),
|
||||
# method='POST',
|
||||
# user=user,
|
||||
# url_kwargs={'uuid': uuid},
|
||||
# req_kwargs=self.change_data)
|
||||
|
||||
# self.assertEqual(reset_res.status_code, 302)
|
||||
# self.assertEqual(reset_res.url, reverse('common-index'))
|
||||
|
||||
Reference in New Issue
Block a user