def test_form_with_different_passwords_fails(self): form = UserRegistrationForm({ 'email': '*****@*****.**', 'password1': 'alpha', 'password2': 'omega', }) eq_(form.is_valid(), False) ok_(form.non_field_errors())