|
@@ 94-105 (lines=12) @@
|
| 91 |
|
raise AssertionError() |
| 92 |
|
|
| 93 |
|
|
| 94 |
|
def test_list_total_length(session): |
| 95 |
|
"""Test if it returns the total list of users.""" |
| 96 |
|
columns = [ColumnDT(User.id)] |
| 97 |
|
|
| 98 |
|
query = session.query() |
| 99 |
|
|
| 100 |
|
params = create_dt_params(columns, length=-1) |
| 101 |
|
rowTable = DataTables(params, query, columns) |
| 102 |
|
res = rowTable.output_result() |
| 103 |
|
|
| 104 |
|
if not len(res['data']) == 50: |
| 105 |
|
raise AssertionError() |
| 106 |
|
|
| 107 |
|
|
| 108 |
|
@pytest.fixture(scope="function") |
|
@@ 62-73 (lines=12) @@
|
| 59 |
|
raise AssertionError() |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
def test_list_fixed_length(session): |
| 63 |
|
"""Test if it returns a fixed list of users.""" |
| 64 |
|
columns = [ColumnDT(User.id)] |
| 65 |
|
|
| 66 |
|
query = session.query() |
| 67 |
|
|
| 68 |
|
params = create_dt_params(columns, length=7) |
| 69 |
|
rowTable = DataTables(params, query, columns) |
| 70 |
|
res = rowTable.output_result() |
| 71 |
|
|
| 72 |
|
if not len(res['data']) == 7: |
| 73 |
|
raise AssertionError() |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
def test_list_inner_join(session): |
|
@@ 29-40 (lines=12) @@
|
| 26 |
|
raise AssertionError() |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
def test_list_bad_length(session): |
| 30 |
|
"""Test if it returns an error for querying with a bad length.""" |
| 31 |
|
columns = [ColumnDT(User.id)] |
| 32 |
|
|
| 33 |
|
query = session.query() |
| 34 |
|
|
| 35 |
|
params = create_dt_params(columns, length=-10) |
| 36 |
|
rowTable = DataTables(params, query, columns) |
| 37 |
|
res = rowTable.output_result() |
| 38 |
|
|
| 39 |
|
if 'Length should be' not in res['error']: |
| 40 |
|
raise AssertionError() |
| 41 |
|
|
| 42 |
|
|
| 43 |
|
def test_list_detail(session): |