S
S
Socrates2018-03-15 12:42:23
Django
Socrates, 2018-03-15 12:42:23

Testing user registration?

Guys, help me understand.
There is a registration of new users, I'm trying to write a test.
what is now:

class UserFormTest(TestCase):
    def test_forms(self):
        form_data = {'email': '[email protected]'}
        form = UserForm(data=form_data)
        self.assertTrue(form.is_valid())

Upon successful registration of an authorized user, it will redirect to the main page.
now just one mail field is being tested, how can I check if the user is redirecting or not in the test?
how to check if a new user has appeared in the user model?
Please don't post a link to the djbook, I re-read it there, I still don't get it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question