Thanks Vijay. It works.

On Thursday, 17 August 2017 18:20:48 UTC+8, Desmond Lim wrote:
>
> Hi there,
>
> I'm wonder, how do we create a verified user for testing purpose
>
> I have this line that creates a user
>
> *cls.user = get_user_model().objects.create_user(username='testuser', 
> email='testu...@testing.com <testu...@testing.com>', password='password')*
>
>
> When I do a test of this for my custom login interface
>
>
>
>
>
>
>
>
>
>
>
> *def test_login_page_login_without_verification(self):    response = 
> self.client.post(        reverse('account_login'),        {            
> 'login': 'testu...@docdoc.com <testu...@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+unsubscr...@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/920c8f95-26e7-4989-b906-8b8b001b79b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to