Code Duplication    Length = 9-10 lines in 2 locations

tests/test_charts_builder.py 2 locations

@@ 216-225 (lines=10) @@
213
    readfunc = read(override=dict(view))
214
    monkeypatch.setattr(charts_builder.adapter, 'read', readfunc)
215
    res = test.get(url_for('jsondash.view', c_id=view['id']))
216
    dom = pq(res.data)
217
    assert len(dom.find('.item')) == len(view['modules'])
218
    assert len(dom.find('.charts-input-icon')) == 1
219
220
221
def test_get_view_valid_modules_valid_dash_title(monkeypatch, ctx, client):
222
    app, test = client
223
    monkeypatch.setattr(charts_builder, 'auth', auth_ok)
224
    view = get_json_config('inputs.json')
225
    readfunc = read(override=dict(view))
226
    monkeypatch.setattr(charts_builder.adapter, 'read', readfunc)
227
    res = test.get(url_for('jsondash.view', c_id=view['id']))
228
    dom = pq(res.data)
@@ 228-236 (lines=9) @@
225
    readfunc = read(override=dict(view))
226
    monkeypatch.setattr(charts_builder.adapter, 'read', readfunc)
227
    res = test.get(url_for('jsondash.view', c_id=view['id']))
228
    dom = pq(res.data)
229
    assert dom.find('.dashboard-title').text() == view['name']
230
231
232
@pytest.mark.invalid_id_redirect
233
def test_get_view_invalid_id_redirect(monkeypatch, ctx, client):
234
    app, test = client
235
    monkeypatch.setattr(charts_builder, 'auth', auth_ok)
236
    res = test.get(url_for('jsondash.view', c_id='123'))
237
    assert REDIRECT_MSG in res.data
238
239