Check that the created user has the "is_active" field set to True
On Thu, Aug 17, 2017 at 2:41 AM, Desmond Lim <limwenpin@gmail.com> wrote:
Hi there,--I'm wonder, how do we create a verified user for testing purposeI have this line that creates a usercls.user = get_user_model().objects.create_user(username=' testuser', email='testuser@testing.com', password='password') When I do a test of this for my custom login interfacedef test_login_page_login_without_verification(self):
response = self.client.post(
reverse('account_login'),
{
'login': 'testuser@docdoc.com',
'password': 'password',
}
)
self.assertRedirects(response, '/accounts/testuser/')I keep getting the error that it redirects to /accounts/confirm-email/ (which is the verification page). I'm wondering, how can I make the user verified or create a verified user, so that I can test that a verified user will be redirected to the correct page after login.Thanks.Desmond
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com .
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/128591dc- .b8c0-4f78-af86-faf7a42f3f0a% 40googlegroups.com
For more options, visit https://groups.google.com/d/optout .
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei3NdUrNDfZtf7_66gcvA3Qz7Yukjg%2B43i%3DRgb47XUprLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment