'Test force update option.'

def test_force_update_enabled(self):

    mock_component(self.hass, 'mqtt')
    assert setup_component(self.hass, sensor.DOMAIN, {sensor.DOMAIN: {'platform': 'mqtt', 'name': 'test', 'state_topic': 'test-topic', 'unit_of_measurement': 'fav    unit', 'force_update': True}})
    events = []
    @ha.callback
    def callback(event):
        events.append(event)
    self.hass.bus.listen(EVENT_STATE_CHANGED, callback)
    fire_mqtt_message(self.hass, 'test-topic', '100')
    self.hass.block_till_done()
    self.assertEqual(1, len(events))
    fire_mqtt_message(self.hass, 'test-topic', '100')
    self.hass.block_till_done()
    self.assertEqual(2, len(events))
