diff options
| author | Luca Beltrame <einar@heavensinferno.net> | 2010-11-21 13:00:56 +0100 |
|---|---|---|
| committer | Luca Beltrame <einar@heavensinferno.net> | 2010-11-21 13:00:56 +0100 |
| commit | 25da44f56980ac8ddc7aa4b034ab0ec9a1ebd5e7 (patch) | |
| tree | 425e77a211d933c774e83ec6007d1933a04a6a8c /test_tablib.py | |
| parent | 91bd4eb9c736270ab5b5eb88f7ebaa790c0ddcfc (diff) | |
| download | tablib-25da44f56980ac8ddc7aa4b034ab0ec9a1ebd5e7.tar.gz | |
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.
Diffstat (limited to 'test_tablib.py')
| -rwxr-xr-x | test_tablib.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test_tablib.py b/test_tablib.py index 8e2454f..bc660fe 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -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.""" |
