Ejemplo n.º 1
0
def user_password_service(pyramid_config):
    service = mock.Mock(spec_set=UserPasswordService())

    def password_setter(user, password):
        user.password = '******'
    service.update_password.side_effect = password_setter

    pyramid_config.register_service(service, name='user_password')
    return service
Ejemplo n.º 2
0
def user_password_service(pyramid_config):
    service = mock.Mock(spec_set=UserPasswordService())

    def password_setter(user, password):  # pylint:disable=unused-argument
        user.password = "******"

    service.update_password.side_effect = password_setter

    pyramid_config.register_service(service, name="user_password")
    return service
Ejemplo n.º 3
0
def user_password_service(pyramid_config):
    service = Mock(spec_set=UserPasswordService())
    service.check_password.return_value = True
    pyramid_config.register_service(service, name='user_password')
    return service
Ejemplo n.º 4
0
def password_service(hasher):
    password_service = UserPasswordService()
    password_service.hasher = hasher
    return password_service
Ejemplo n.º 5
0
 def svc(self, hasher):
     svc = UserPasswordService()
     svc.hasher = hasher
     return svc
Ejemplo n.º 6
0
 def test_uses_global_password_context_by_default(self):
     svc = UserPasswordService()
     assert svc.hasher == password_context
Ejemplo n.º 7
0
def user_password_service(pyramid_config):
    service = mock.Mock(spec_set=UserPasswordService())
    pyramid_config.register_service(service, name='user_password')
    return service
Ejemplo n.º 8
0
 def svc(self, hasher):
     svc = UserPasswordService()
     svc.hasher = hasher
     return svc