コード例 #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())
コード例 #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())
コード例 #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())
コード例 #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())
コード例 #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())
コード例 #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())