From e17c46c5334fa3d34068342802607ca7a9957b61 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 22 Oct 2014 13:40:45 +0200 Subject: [PATCH] fixed error when passing elements to TableCell's and TableHeaderCell's constructor --- NEWS.rst | 9 +++++++++ htmlgen/table.py | 2 +- test_htmlgen/table.py | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index 4a4956b..89102c6 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1,3 +1,12 @@ +News in version 0.6.1 +===================== + +Bug Fixes +--------- + + * Fixed error when passing elements to TableCell's and TableHeaderCell's + constructor. + News in version 0.6 =================== diff --git a/htmlgen/table.py b/htmlgen/table.py index ab65236..47963bc 100644 --- a/htmlgen/table.py +++ b/htmlgen/table.py @@ -275,7 +275,7 @@ class _TableCellBase(Element): def __init__(self, element_name, *content): super(_TableCellBase, self).__init__(element_name) - self.extend(*content) + self.extend(content) rows = int_html_attribute("rowspan", 1) columns = int_html_attribute("colspan", 1) diff --git a/test_htmlgen/table.py b/test_htmlgen/table.py index 2039138..723cee1 100644 --- a/test_htmlgen/table.py +++ b/test_htmlgen/table.py @@ -2,7 +2,7 @@ from asserts import assert_equal, assert_true -from htmlgen import Table, TableHead, TableRow, TableCell, ColumnGroup +from htmlgen import Table, TableHead, TableRow, TableCell, ColumnGroup, Span class TableTest(TestCase): @@ -154,6 +154,10 @@ def test_columns_and_rows(self): cell.rows = 5 assert_equal('Content', str(cell)) + def test_element_child(self): + cell = TableCell(Span("Content")) + assert_equal('Content', str(cell)) + class ColumnGroupTest(TestCase):