mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
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:
@@ -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."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user