summaryrefslogtreecommitdiffstats
path: root/tests/test_schema1.py
blob: 552a392bccb71fef3f03c0f5244cb37fe72c93b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-

from utils import login, get_table


def test_simple(schema1, app, admin):
    login(app, admin)
    response = app.get('/').follow()
    response = response.click('Facts 1')
    assert 'big-msg-info' in response
    form = response.form
    form.set('representation', 'table')
    form.set('measure', 'simple_count')
    form.set('drilldown_x', 'innersubcategory')
    response = form.submit('visualize')
    assert 'big-msg-info' not in response
    assert get_table(response) == [
        [u'Inner SubCategory', u'subé1', u'subé3'],
        ['number of rows', '15', '1'],
    ]
    form = response.form
    form.set('representation', 'table')
    form.set('measure', 'simple_count')
    form.set('drilldown_x', 'date__month')
    response = form.submit('visualize')
    assert 'big-msg-info' not in response
    assert get_table(response) == [
        ['mois (Date)', 'janvier', u'f\xe9vrier', 'mars', 'avril', 'mai', 'juin', 'juillet', u'ao\xfbt'],
        ['number of rows', '10', '1', '1', '1', '1', '1', '1', '1'],
    ]