    def assert_canvas_equals(self, canvas, expected):
        """
        Assert output to canvas is as expected.
        """
        output = self._canvas_to_string(canvas)
        self.assertEqual(output, expected)
Assert output to canvas is as expected.
tests/test_widgets.py