def METHOD_NAME(monkeypatch, password, username, expected):
    signal_called = False
    def _mock_pwned(password, fast=False):
        return password == 'correct horse battery staple'
    def _signal_fn(sender, **kw):
        nonlocal signal_called
        signal_called = True
        assert sender == 'test'
        assert username == kw['username']
        if kw['password'] == 'badsignal':
            return 'signalfail'
    monkeypatch.setattr('indico.util.passwords.check_password_pwned', _mock_pwned)
    with signals.core.check_password_secure.connected_to(_signal_fn):
        rv = validate_secure_password('test', password, username=username)
    assert signal_called
    if expected is None:
        assert rv is None
    else:
        assert expected in rv