utils: handle proxy objects in ods export (#38641)
This commit is contained in:
parent
980cb76aae
commit
a5b82bf9f6
|
@ -323,7 +323,7 @@ class Visualization(object):
|
|||
if self.measure.type == 'integer':
|
||||
try:
|
||||
value = int(value)
|
||||
except ValueError:
|
||||
except (ValueError, TypeError):
|
||||
pass
|
||||
sheet.write(j + 1, i, 0 if value is None else value)
|
||||
return workbook
|
||||
|
|
|
@ -133,6 +133,7 @@ def test_ods(schema1, app, admin):
|
|||
form.set('representation', 'table')
|
||||
form.set('measure', 'simple_count')
|
||||
form.set('drilldown_x', 'innersubcategory')
|
||||
form.set('drilldown_y', 'hour')
|
||||
response = form.submit('visualize')
|
||||
assert 'big-msg-info' not in response
|
||||
response = response.click(href='save')
|
||||
|
@ -144,7 +145,7 @@ def test_ods(schema1, app, admin):
|
|||
assert get_table(response) == get_ods_table(ods_response)[1:]
|
||||
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
|
||||
assert len([node for node in nodes if node.attrib['{%s}value-type' % OFFICE_NS] == 'float']) == 4
|
||||
|
||||
app.reset() # logout
|
||||
assert 'login' in app.get(ods_response.request.url, status=302).location
|
||||
|
|
Loading…
Reference in New Issue