def test_register_view(self):
        test_url = reverse('users:register')
        self.generic_test_blank_form(test_url)

        # Test new user can be created, and userprofile connected properly.
        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'))
Lets new user register an account.
dataset/ETHPy150Open openlearningtools/opencompetencies/users/tests.py/UserViewTests.test_register_view