|
@@ 58-68 (lines=11) @@
|
| 55 |
|
assert res.status_code == 200 |
| 56 |
|
for family, config in settings.CHARTS_CONFIG.items(): |
| 57 |
|
for chart in config['charts']: |
| 58 |
|
_, label = chart |
| 59 |
|
assert label in str(res.data) |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
def test_get_dashboard_contains_no_chart_msg(monkeypatch, client): |
| 63 |
|
_, test = client |
| 64 |
|
monkeypatch.setattr(charts_builder, 'auth', auth_valid) |
| 65 |
|
res = str(test.get(url_for('jsondash.dashboard')).data) |
| 66 |
|
assert 'No dashboards exist. Create one below to get started.' in res |
| 67 |
|
|
| 68 |
|
|
| 69 |
|
def test_dashboards_override_perpage_pagination(monkeypatch, client): |
| 70 |
|
_, test = client |
| 71 |
|
monkeypatch.setattr(charts_builder, 'auth', auth_valid) |
|
@@ 71-80 (lines=10) @@
|
| 68 |
|
|
| 69 |
|
def test_dashboards_override_perpage_pagination(monkeypatch, client): |
| 70 |
|
_, test = client |
| 71 |
|
monkeypatch.setattr(charts_builder, 'auth', auth_valid) |
| 72 |
|
for i in range(10): |
| 73 |
|
data = dict(name=i, modules=[]) |
| 74 |
|
res = test.post(url_for('jsondash.create'), data=data) |
| 75 |
|
res = test.get(url_for('jsondash.dashboard') + '?per_page=2') |
| 76 |
|
# Ensure 10 exist, but only 5 are shown |
| 77 |
|
assert len(read()) == 10 |
| 78 |
|
dom = pq(res.data) |
| 79 |
|
assert len(dom.find('.pagination').find('li:not(.active)')) == 5 |
| 80 |
|
|
| 81 |
|
|
| 82 |
|
def test_create_dashboards_check_index_count(monkeypatch, client): |
| 83 |
|
_, test = client |