def METHOD_NAME(self, logger_mock):
    """Missing API settings should return stats with 0."""
    expected_stats = {"nb_views": 0}
    video = VideoFactory()
    # No settings
    self.assertEqual(expected_stats, grafana_xapi_fun_backend(video))
    logger_mock.info.assert_called_with(
        "missing settings to connect to grafana API"
    )
    required_settings = {
        "api_key": "any",
        "api_endpoint": "any",
        "api_datasource_id": "any",
        "api_datastream": "any",
    }
    for key in required_settings:
        # One setting empty
        settings = required_settings.copy()
        settings[key] = None
        self.assertEqual(
            expected_stats, grafana_xapi_fun_backend(video, **settings)
        )
        logger_mock.info.assert_called_with(
            "missing settings to connect to grafana API"
        )
        logger_mock.reset_mock()
        # One setting missing
        del settings[key]
        self.assertEqual(
            expected_stats, grafana_xapi_fun_backend(video, **settings)
        )
        logger_mock.info.assert_called_with(
            "missing settings to connect to grafana API"
        )
        logger_mock.reset_mock()