def test_get_state_flushes_data_cached_by_channels(self):
        """should return the state of the channels stored before created"""
        self.widget.set(self.name, 'myvalue')

        comm = Mock(spec=Comm)
        channels = Channels(comm=comm)
        state = channels.get_state()

        self.assertEqual(state, {"c:{}".format(self.name): 'myvalue'})
        self.assertTrue(not widget_channels.channel_data)
    def test_get_state_flushes_data_cached_by_channels(self):
        """should return the state of the channels stored before created"""
        self.widget.set(self.name, "myvalue")

        comm = Mock(spec=Comm)
        channels = Channels(comm=comm)
        state = channels.get_state()

        self.assertEqual(state, {"c:{}".format(self.name): "myvalue"})
        self.assertTrue(not widget_channels.channel_data)