|
@@ 57-66 (lines=10) @@
|
| 54 |
|
assert read()[0]['created_by'] == 'Username' |
| 55 |
|
|
| 56 |
|
|
| 57 |
|
@pytest.mark.globalflag |
| 58 |
|
def test_set_global_flag_when_creating_dashboard(ctx, client, monkeypatch): |
| 59 |
|
app, test = client |
| 60 |
|
app.config['JSONDASH_GLOBALDASH'] = True |
| 61 |
|
monkeypatch.setattr(charts_builder, 'auth', auth_valid) |
| 62 |
|
data = dict(name='global-check', is_global='on') |
| 63 |
|
test.post('/charts/create', data=data).data |
| 64 |
|
assert len(read()) == 1 |
| 65 |
|
assert read()[0]['name'] == 'global-check' |
| 66 |
|
assert read()[0]['created_by'] == app.config.get('JSONDASH_GLOBAL_USER') |
| 67 |
|
|
| 68 |
|
|
| 69 |
|
@pytest.mark.globalflag |
|
@@ 45-54 (lines=10) @@
|
| 42 |
|
return view |
| 43 |
|
|
| 44 |
|
|
| 45 |
|
@pytest.mark.globalflag |
| 46 |
|
def test_noset_global_flag_when_creating_dashboard(ctx, client, monkeypatch): |
| 47 |
|
app, test = client |
| 48 |
|
app.config['JSONDASH_GLOBALDASH'] = True |
| 49 |
|
monkeypatch.setattr(charts_builder, 'auth', auth_valid) |
| 50 |
|
data = dict(name='global-check') |
| 51 |
|
test.post('/charts/create', data=data).data |
| 52 |
|
assert len(read()) == 1 |
| 53 |
|
assert read()[0]['name'] == 'global-check' |
| 54 |
|
assert read()[0]['created_by'] == 'Username' |
| 55 |
|
|
| 56 |
|
|
| 57 |
|
@pytest.mark.globalflag |