|
@@ 51-61 (lines=11) @@
|
| 48 |
|
assert 'No dashboards exist. Create one below to get started.' in res |
| 49 |
|
|
| 50 |
|
|
| 51 |
|
def test_dashboards_override_perpage_pagination(monkeypatch, ctx, client): |
| 52 |
|
app, test = client |
| 53 |
|
monkeypatch.setattr(charts_builder, 'auth', auth_valid) |
| 54 |
|
for i in range(10): |
| 55 |
|
data = dict(name=i, modules=[]) |
| 56 |
|
res = test.post(url_for('jsondash.create'), data=data) |
| 57 |
|
res = test.get(url_for('jsondash.dashboard') + '?per_page=2') |
| 58 |
|
# Ensure 10 exist, but only 5 are shown |
| 59 |
|
assert len(read()) == 10 |
| 60 |
|
dom = pq(res.data) |
| 61 |
|
assert len(dom.find('.pagination').find('li:not(.active)')) == 5 |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
def test_create_dashboards_check_index_count(monkeypatch, ctx, client): |
|
@@ 64-73 (lines=10) @@
|
| 61 |
|
assert len(dom.find('.pagination').find('li:not(.active)')) == 5 |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
def test_create_dashboards_check_index_count(monkeypatch, ctx, client): |
| 65 |
|
app, test = client |
| 66 |
|
monkeypatch.setattr(charts_builder, 'auth', auth_valid) |
| 67 |
|
for i in range(10): |
| 68 |
|
data = dict(name=i, modules=[]) |
| 69 |
|
res = test.post(url_for('jsondash.create'), data=data) |
| 70 |
|
res = test.get(url_for('jsondash.dashboard')) |
| 71 |
|
assert len(read()) == 10 |
| 72 |
|
heading = pq(res.data).find('h1.lead').text() |
| 73 |
|
assert 'Showing 10 dashboards with 0 charts' in heading |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
def test_get_view_valid_id_invalid_config(monkeypatch, ctx, client): |