diff --git a/tests/fixtures/schema1/01_schema.json b/tests/fixtures/schema1/01_schema.json index 7b487cc..6d13a3a 100644 --- a/tests/fixtures/schema1/01_schema.json +++ b/tests/fixtures/schema1/01_schema.json @@ -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", diff --git a/tests/test_schema1.py b/tests/test_schema1.py index 1c0e124..ae01abc 100644 --- a/tests/test_schema1.py +++ b/tests/test_schema1.py @@ -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'], + ]