def test_password_field_to_son(self): field = PasswordField() value = field.to_son(PasswordType('xxx')) eq_(value, 'f561aaf6ef0bf14d4208bb46a4ccb3ad') value = field.to_son('xxx') eq_(value, 'f561aaf6ef0bf14d4208bb46a4ccb3ad')
def test_password_field_to_son(self): field = PasswordField() value = field.to_son(PasswordType('xxx')) eq_(value, HASH_XXX) value = field.to_son('xxx') eq_(value, HASH_XXX)
def test_password_field_to_son_wrong_value(self): field = PasswordField() field.to_son(5)