tests: add test on timestamp column

This commit is contained in:
Benjamin Dauvergne 2019-01-18 23:01:27 +01:00
parent af366be498
commit a0192447b4
2 changed files with 31 additions and 0 deletions

View File

@ -74,6 +74,12 @@
"type": "date",
"value": "date"
},
{
"name": "datetime",
"label": "Datetime",
"type": "date",
"value": "datetime"
},
{
"name": "boolean",
"label": "Boolean",

View File

@ -119,3 +119,28 @@ def test_ods(schema1, app, admin):
root = get_ods_document(ods_response)
nodes = root.findall('.//{%s}table-cell' % TABLE_NS)
assert len([node for node in nodes if node.attrib['{%s}value-type' % OFFICE_NS] == 'float']) == 2
def test_truncated_previous_year_range_on_datetime(schema1, app, admin, freezer):
login(app, admin)
response = app.get('/').follow()
response = response.click('Facts 1')
form = response.form
form.set('representation', 'table')
form.set('measure', 'simple_count')
form.set('drilldown_x', 'date__month')
form.set('drilldown_y', 'date__year')
form.set('filter__datetime_2', 'since_1jan_last_year')
freezer.move_to('2019-01-01 01:00:00')
response = form.submit('visualize')
assert get_table(response) == [
['', 'Total'],
['Total', '0']
]
freezer.move_to('2018-01-01 01:00:00')
response = form.submit('visualize')
assert get_table(response) == [
['', 'janvier', u'f\xe9vrier', 'mars', 'avril', 'mai', 'juin', 'juillet', u'ao\xfbt', 'Total'],
['2017', '10', '1', '1', '1', '1', '1', '1', '1', '17'],
['Total', '10', '1', '1', '1', '1', '1', '1', '1', '17'],
]