'Test json location message.'

def test_json_message(self):

    dev_id = 'zanzito'
    topic = 'location/zanzito'
    location = json.dumps(LOCATION_MESSAGE)
    assert setup_component(self.hass, device_tracker.DOMAIN, {device_tracker.DOMAIN: {CONF_PLATFORM: 'mqtt_json', 'devices': {dev_id: topic}}})
    fire_mqtt_message(self.hass, topic, location)
    self.hass.block_till_done()
    state = self.hass.states.get('device_tracker.zanzito')
    self.assertEqual(state.attributes.get('latitude'), 2.0)
    self.assertEqual(state.attributes.get('longitude'), 1.0)
