Code Duplication    Length = 15-15 lines in 2 locations

tests/test_layouts_grid.py 1 location

@@ 19-33 (lines=15) @@
16
    assert len(container.find('.add-new-row-container')) == 2
17
18
19
def test_grid_mode_has_2_rows(monkeypatch, ctx, client):
20
    app, test = client
21
    data = dict(
22
        mode='grid',
23
        name='Some dashboard',
24
        module_foo=json.dumps(
25
            dict(name=1, width=1, height=1, dataSource='...', row=2)
26
        ),
27
        module_bar=json.dumps(
28
            dict(name=1, width=1, height=1, dataSource='...', row=1),
29
        ),
30
    )
31
    dom = setup_dashboard(monkeypatch, app, test, data)
32
    container = dom.find('#container')
33
    assert len(container.find('.grid-row')) == 2
34
35
36
def test_grid_mode_has_correct_cols(monkeypatch, ctx, client):

tests/test_layouts_freeform.py 1 location

@@ 6-20 (lines=15) @@
3
from conftest import setup_dashboard
4
5
6
def test_freeform_mode_has_no_rows_or_cols(monkeypatch, ctx, client):
7
    app, test = client
8
    data = dict(
9
        mode='freeform',
10
        name='Some dashboard',
11
        module_baz=json.dumps(
12
            dict(name=1, width=400, height=112, dataSource='...')
13
        ),
14
        module_foo=json.dumps(
15
            dict(name=1, width=300, height=112, dataSource='...')
16
        ),
17
    )
18
    dom = setup_dashboard(monkeypatch, app, test, data)
19
    container = dom.find('#container')
20
    assert len(container.find('.grid-row')) == 0
21