def test_create_idenity_pass(self): data = { 'password': self.password, 'password2': self.password, 'email': self.username, } form = CreateIdentityForm(data=data) assert_equals(True, form.is_valid())
def test_mismatch_passwords_failed(self): data = { 'password': self.password, 'password2': "not %s" % self.password, 'email': self.username, } form = CreateIdentityForm(data=data) assert_equals(False, form.is_valid()) assert_equals(['password2'], form.errors.keys())
def test_create_colliding_identity_fail(self): data = { 'password': self.password, 'password2': self.password, 'email': self.username, } form = CreateIdentityForm(data=data) assert_equals(True, form.is_valid()) form.save() form2 = CreateIdentityForm(data=data) assert_equals(False, form2.is_valid())