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
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
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
def password_service(hasher): password_service = UserPasswordService() password_service.hasher = hasher return password_service
def svc(self, hasher): svc = UserPasswordService() svc.hasher = hasher return svc
def test_uses_global_password_context_by_default(self): svc = UserPasswordService() assert svc.hasher == password_context
def user_password_service(pyramid_config): service = mock.Mock(spec_set=UserPasswordService()) pyramid_config.register_service(service, name='user_password') return service