tests: add test on sum of integers measures (#44289)

This commit is contained in:
Benjamin Dauvergne 2020-06-19 16:28:57 +02:00
parent be85302f2d
commit ffb9a32285
2 changed files with 28 additions and 0 deletions

View File

@ -236,6 +236,12 @@
"label": "geolocation",
"name": "geolocation",
"type": "point"
},
{
"name": "sum_integer",
"label": "sum of integer column",
"expression": "SUM({fact_table}.\"integer\")",
"type": "integer"
}
],
"name": "facts1",

View File

@ -375,3 +375,25 @@ def test_json_dimensions(schema1, app, admin):
['A', 'x', 'y', 'z'],
['number of rows', '7', '9', '0']
]
def test_sum_integer_measure(schema1, app, admin):
login(app, admin)
response = app.get('/')
response = response.click('schema1')
response = response.click('Facts 1')
form = response.form
form.set('representation', 'table')
form.set('measure', 'sum_integer')
form.set('drilldown_x', 'string')
response = form.submit('visualize')
assert get_table(response) == [
['String', 'a', 'b', 'c', 'Aucun(e)'],
['sum of integer column', '11', '2', '3', '1'],
]
form.set('filter__string', ['a', 'b', '__none__'])
response = form.submit('visualize')
assert get_table(response) == [
['String', 'a', 'b', 'Aucun(e)'],
['sum of integer column', '11', '2', '1'],
]