    def test_background(self):
        """
        Check Background widget works as expected.
        """
        screen = MagicMock(spec=Screen, colours=8, unicode_aware=False)
        scene = Scene([], -1)
        canvas = Canvas(screen, 10, 40, 0, 0)
        form = Background(canvas, bg=7)
        scene.add_effect(form)
        form.reset()

        # Check that the widget is rendered correctly.
        form.update(0)
        for y in range(canvas.height):
            for x in range(canvas.width):
                char, _, _, bg = canvas.get_from(x, y)
                self.assertEqual(char, ord(" "))
                self.assertEqual(bg, 7)

        # Check properties
        self.assertEqual(form.stop_frame, 0)
        self.assertGreater(form.frame_update_count, 1000)
Check Background widget works as expected.
tests/test_widgets.py