Check that the created user has the "is_active" field set to True

On Thu, Aug 17, 2017 at 2:41 AM, Desmond Lim <[email protected]> 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='[email protected] <[email protected]>', 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': '[email protected] <[email protected]>',            '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 [email protected].
> To post to this group, send email to [email protected].
> 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
> <https://groups.google.com/d/msgid/django-users/128591dc-b8c0-4f78-af86-faf7a42f3f0a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To post to this group, send email to [email protected].
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.

Reply via email to