Exemplo n.º 1
0
    def test_password(self):
        from ptah.password import PasswordSchema

        pwdSchema = PasswordSchema.bind(
            params={'password': '******', 'confirm_password': '******'})
        data, errors = pwdSchema.extract()
        self.assertEqual(len(errors), 0)
Exemplo n.º 2
0
    def test_password(self):
        from ptah.password import PasswordSchema

        pwdSchema = PasswordSchema.bind(
            self.request,
            params={'password': '******', 'confirm_password': '******'})
        data, errors = pwdSchema.extract()
        self.assertEqual(len(errors), 0)
Exemplo n.º 3
0
    def test_password_required(self):
        from ptah.password import PasswordSchema

        pwdSchema = PasswordSchema.bind(self.request, params={})

        data, errors = pwdSchema.extract()
        self.assertEqual(len(errors), 2)
        self.assertEqual(errors[0].field.name, 'password')
Exemplo n.º 4
0
    def test_password_equal(self):
        from ptah.password import PasswordSchema

        pwdSchema = PasswordSchema.bind(
            params={'password': '******', 'confirm_password': '******'})
        data, errors = pwdSchema.extract()

        self.assertEqual(len(errors), 1)
        self.assertIsInstance(errors[0].field, form.Fieldset)
        self.assertEqual(
            errors[0].msg[0],
            "Password and Confirm Password should be the same.")
Exemplo n.º 5
0
    def test_password_equal(self):
        from ptah.password import PasswordSchema

        pwdSchema = PasswordSchema.bind(
            self.request,
            params={'password': '******', 'confirm_password': '******'})
        data, errors = pwdSchema.extract()

        self.assertEqual(len(errors), 1)
        self.assertIsInstance(errors[0].field, ptah.form.Fieldset)
        self.assertEqual(
            errors[0].msg[0],
            "Password and Confirm Password should be the same.")