

def test_register_view(self):
    'Lets new user register an account.'
    test_url = reverse('users:register')
    self.generic_test_blank_form(test_url)
    response = self.client.post(test_url, {
        'username': 'ozzy',
        'email': '',
        'password1': 'pw',
        'password2': 'pw',
    })
    self.assertEqual(response.status_code, 302)
    new_user = User.objects.filter(username='ozzy')[0]
    self.assertTrue(hasattr(new_user, 'userprofile'))

dataset/ETHPy150Open openlearningtools/opencompetencies/users/tests.py UserViewTests.test_register_view/original