Esempio n. 1
0
    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())
Esempio n. 2
0
    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())
Esempio n. 3
0
    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())
Esempio n. 4
0
    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())
Esempio n. 5
0
    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())
Esempio n. 6
0
    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())