Projet

Général

Profil

0001-admin-add-ellipsis-at-the-end-of-data-source-preview.patch

Frédéric Péters, 24 octobre 2016 21:20

Télécharger (1,67 ko)

Voir les différences:

Subject: [PATCH] admin: add ellipsis at the end of data source preview
 (#13725)

 tests/test_admin_pages.py | 7 +++++++
 wcs/admin/data_sources.py | 2 ++
 2 files changed, 9 insertions(+)
tests/test_admin_pages.py
3369 3369
    assert 'Preview' in resp.body
3370 3370
    assert 'foo' in resp.body
3371 3371

  
3372
    data_source.data_source = {'type': 'formula', 'value': '[str(x) for x in range(100)]'}
3373
    data_source.store()
3374
    resp = app.get('/backoffice/settings/data-sources/%s/' % data_source.id)
3375
    assert 'Preview' in resp.body
3376
    assert resp.body.count('<li>') < 100
3377
    assert '<li>...</li>' in resp.body
3378

  
3372 3379
def test_data_sources_edit(pub):
3373 3380
    create_superuser(pub)
3374 3381
    NamedDataSource.wipe()
wcs/admin/data_sources.py
138 138
                        else:
139 139
                            r += htmltext('<li><tt>%s</tt>: %s</li>') % (
140 140
                                    item.get('id'), item.get('text'))
141
                    if len(items) > 10:
142
                        r += htmltext('<li>...</li>')
141 143
                    r += htmltext('</ul></div>')
142 144
        else:
143 145
            # the data source field is required so this should never happen
144
-