diff --git a/tests/basic_rendering_test.py b/tests/basic_rendering_test.py index 2b61dc7..33d6efa 100644 --- a/tests/basic_rendering_test.py +++ b/tests/basic_rendering_test.py @@ -208,8 +208,8 @@ def test_flatten_element_lists(): def test_flatten_element_generators(): """ - If a list of elements is given as a child element, each element should be - considered as a child. + If a generator of elements is given as a child element, each element + yielded should be considered as a child. """ doc = html(c for c in "hi") @@ -221,6 +221,21 @@ def test_flatten_element_generators(): ]) +def test_flatten_element_other_sequence(): + """ + If a tuple of elements is given as a child element, each element should be + considered as a child. + """ + doc = html(("h", "i")) + + assert str(doc) == "\n".join([ + "", + " h", + " i", + "", + ]) + + def test_classes_can_render(): """ Can a class by itself be rendered individually?