def test_registration_failure(self):
        resp = self.client.post(reverse('registration_register'),
                                data={'username': 'bob',
                                      'email': 'bob@example.com',
                                      'password1': 'secret',
                                      'password2': 'notsecret'})
        self.assertEqual(200, resp.status_code)
        self.failIf(resp.context['form'].is_valid())
Registering with invalid data fails.
dataset/ETHPy150Open macropin/django-registration/registration/tests/simple_backend.py/SimpleBackendViewTests.test_registration_failure