Support for HTML (export only). Unit-tested. Depends on the "markup.py"

package(http://markup.sourceforge.net) which is included in packages/
Notice that the tests now depend on the presence of markup.py.
This commit is contained in:
Luca Beltrame
2010-11-21 13:00:56 +01:00
parent 91bd4eb9c7
commit 25da44f569
5 changed files with 555 additions and 1 deletions
+23
View File
@@ -5,6 +5,7 @@
import unittest
import markup
import tablib
@@ -182,6 +183,27 @@ class TablibTestCase(unittest.TestCase):
self.assertEqual(tsv, self.founders.tsv)
def test_html_export(self):
"""HTML export"""
html = markup.page()
html.table.open()
html.thead.open()
html.tr(markup.oneliner.th(self.founders.headers))
html.thead.close()
for founder in self.founders:
html.tr(markup.oneliner.td(founder))
html.table.close()
html = str(html)
self.assertEqual(html, self.founders.html)
def test_unicode_append(self):
"""Passes in a single unicode charecter and exports."""
@@ -403,6 +425,7 @@ class TablibTestCase(unittest.TestCase):
("John", "Adams", 90, "John", "Adams", 90))
def test_wipe(self):
"""Purge a dataset."""