Skip to content

Commit

Permalink
fixed error when passing elements to TableCell's and TableHeaderCell'…
Browse files Browse the repository at this point in the history
…s constructor
  • Loading branch information
srittau committed Oct 22, 2014
1 parent b030558 commit e17c46c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -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
===================

Expand Down
2 changes: 1 addition & 1 deletion htmlgen/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion test_htmlgen/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -154,6 +154,10 @@ def test_columns_and_rows(self):
cell.rows = 5
assert_equal('<td colspan="3" rowspan="5">Content</td>', str(cell))

def test_element_child(self):
cell = TableCell(Span("Content"))
assert_equal('<td><span>Content</span></td>', str(cell))


class ColumnGroupTest(TestCase):

Expand Down

0 comments on commit e17c46c

Please sign in to comment.