Merge pull request #259 from dyve/master

Fix #260 date and datetime export to JSON
This commit is contained in:
Iuri de Silvio
2016-12-18 19:09:26 -02:00
committed by GitHub
3 changed files with 30 additions and 2 deletions
+3
View File
@@ -26,3 +26,6 @@ junit-py27.xml
# tox noise
.tox
# pyenv noise
.python-version
+4 -2
View File
@@ -5,8 +5,10 @@
import tablib
import sys
from tablib.packages import omnijson as json
try:
import json
except ImportError:
from tablib.packages import omnijson as json
title = 'json'
+23
View File
@@ -6,6 +6,9 @@ import json
import unittest
import sys
import os
import datetime
import tablib
from tablib.compat import markup, unicode, is_py3
from tablib.core import Row
@@ -381,6 +384,26 @@ class TablibTestCase(unittest.TestCase):
data.html
data.latex
def test_datetime_append(self):
"""Passes in a single datetime and a single date and exports."""
new_row = (
datetime.datetime.now(),
datetime.datetime.today(),
)
data.append(new_row)
data.json
data.yaml
data.csv
data.tsv
data.xls
data.xlsx
data.ods
data.html
data.latex
def test_book_export_no_exceptions(self):
"""Test that various exports don't error out."""