Skip to content

Commit e17c46c

Browse files
committed
fixed error when passing elements to TableCell's and TableHeaderCell's constructor
1 parent b030558 commit e17c46c

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

NEWS.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
News in version 0.6.1
2+
=====================
3+
4+
Bug Fixes
5+
---------
6+
7+
* Fixed error when passing elements to TableCell's and TableHeaderCell's
8+
constructor.
9+
110
News in version 0.6
211
===================
312

htmlgen/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class _TableCellBase(Element):
275275

276276
def __init__(self, element_name, *content):
277277
super(_TableCellBase, self).__init__(element_name)
278-
self.extend(*content)
278+
self.extend(content)
279279

280280
rows = int_html_attribute("rowspan", 1)
281281
columns = int_html_attribute("colspan", 1)

test_htmlgen/table.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from asserts import assert_equal, assert_true
44

5-
from htmlgen import Table, TableHead, TableRow, TableCell, ColumnGroup
5+
from htmlgen import Table, TableHead, TableRow, TableCell, ColumnGroup, Span
66

77

88
class TableTest(TestCase):
@@ -154,6 +154,10 @@ def test_columns_and_rows(self):
154154
cell.rows = 5
155155
assert_equal('<td colspan="3" rowspan="5">Content</td>', str(cell))
156156

157+
def test_element_child(self):
158+
cell = TableCell(Span("Content"))
159+
assert_equal('<td><span>Content</span></td>', str(cell))
160+
157161

158162
class ColumnGroupTest(TestCase):
159163

0 commit comments

Comments
 (0)