def METHOD_NAME(mocker):
    """
    If the username is too small, we show an informative error message.
    """
    mock_controller = mocker.MagicMock()
    ld = LoginDialog(None)
    ld.setup(mock_controller)
    ld.username_field.text = mocker.MagicMock(return_value="he")
    ld.password_field.text = mocker.MagicMock(return_value="nicelongpassword")
    ld.tfa_field.text = mocker.MagicMock(return_value="123456")
    ld.setDisabled = mocker.MagicMock()
    ld.error = mocker.MagicMock()
    ld.validate()
    assert ld.setDisabled.call_count == 2
    assert ld.error.call_count == 1
    assert mock_controller.login.call_count == 0