372 |
372 |
form.set('filter__a', ['x', 'y'])
|
373 |
373 |
response = form.submit('visualize')
|
374 |
374 |
assert get_table(response) == [
|
375 |
375 |
['A', 'x', 'y', 'z'],
|
376 |
376 |
['number of rows', '7', '9', '0']
|
377 |
377 |
]
|
378 |
378 |
|
379 |
379 |
|
|
380 |
def test_json_dimensions_having_percent(schema1, app, admin):
|
|
381 |
login(app, admin)
|
|
382 |
response = app.get('/')
|
|
383 |
response = response.click('schema1')
|
|
384 |
response = response.click('Facts 1')
|
|
385 |
form = response.form
|
|
386 |
|
|
387 |
form.set('representation', 'table')
|
|
388 |
form.set('measure', 'percent')
|
|
389 |
form.set('drilldown_x', 'a')
|
|
390 |
response = form.submit('visualize')
|
|
391 |
assert get_table(response) == [
|
|
392 |
['A', 'x', 'y', 'z'],
|
|
393 |
['pourcentage des demandes', '41,18 %', '52,94 %', '5,88 %']
|
|
394 |
]
|
|
395 |
|
|
396 |
assert 'filter__a' in form.fields
|
|
397 |
assert set([o[0] for o in form['filter__a'].options]) == {'x', 'y', 'z', '__none__'}
|
|
398 |
|
|
399 |
form.set('filter__a', ['x', 'y'])
|
|
400 |
response = form.submit('visualize')
|
|
401 |
assert get_table(response) == [
|
|
402 |
['A', 'x', 'y', 'z'],
|
|
403 |
['pourcentage des demandes', '43,75 %', '56,25 %', '0,00 %']
|
|
404 |
]
|
|
405 |
|
|
406 |
|
380 |
407 |
def test_sum_integer_measure(schema1, app, admin):
|
381 |
408 |
login(app, admin)
|
382 |
409 |
response = app.get('/')
|
383 |
410 |
response = response.click('schema1')
|
384 |
411 |
response = response.click('Facts 1')
|
385 |
412 |
form = response.form
|
386 |
413 |
form.set('representation', 'table')
|
387 |
414 |
form.set('measure', 'sum_integer')
|
388 |
|
-
|