0001-backoffice-minor-change-to-export-commands-labels-82.patch
tests/test_backoffice_pages.py | ||
---|---|---|
268 | 268 |
create_environment(pub) |
269 | 269 |
app = login(get_app(pub)) |
270 | 270 |
resp = app.get('/backoffice/management/form-title/') |
271 |
resp = resp.click('CSV Export')
|
|
271 |
resp = resp.click('Export as CSV File')
|
|
272 | 272 |
assert resp.headers['content-type'].startswith('text/') |
273 | 273 |
assert len(resp.body.splitlines()) == 18 # 17 + header line |
274 | 274 | |
275 | 275 |
resp = app.get('/backoffice/management/form-title/') |
276 | 276 |
resp.forms[0]['filter'] = 'all' |
277 | 277 |
resp = resp.forms[0].submit() |
278 |
resp = resp.click('CSV Export')
|
|
278 |
resp = resp.click('Export as CSV File')
|
|
279 | 279 |
assert len(resp.body.splitlines()) == 51 |
280 | 280 | |
281 | 281 |
def test_backoffice_ods(pub): |
... | ... | |
283 | 283 |
create_environment(pub) |
284 | 284 |
app = login(get_app(pub)) |
285 | 285 |
resp = app.get('/backoffice/management/form-title/') |
286 |
resp = resp.click('Open Document Format Export')
|
|
286 |
resp = resp.click('Export a Spreadsheet')
|
|
287 | 287 |
assert resp.headers['content-type'] == 'application/vnd.oasis.opendocument.spreadsheet' |
288 | 288 |
assert 'filename=form-title.ods' in resp.headers['content-disposition'] |
289 | 289 |
assert resp.body[:2] == 'PK' # ods has a zip container |
wcs/backoffice/management.py | ||
---|---|---|
372 | 372 |
r += htmltext('<ul id="sidebar-actions">') |
373 | 373 |
#' <li><a href="list%s">%s</a></li>' % (qs, _('List of results')) |
374 | 374 |
r += htmltext(' <li><a data-base-href="ods" href="ods%s">%s</a></li>') % ( |
375 |
qs, _('Open Document Format Export'))
|
|
375 |
qs, _('Export a Spreadsheet'))
|
|
376 | 376 |
r += htmltext(' <li><a data-base-href="csv" href="csv%s">%s</a></li>') % ( |
377 |
qs, _('CSV Export'))
|
|
377 |
qs, _('Export as CSV File'))
|
|
378 | 378 |
if xlwt: |
379 | 379 |
r += htmltext('<li><a data-base-href="xls" href="xls%s">%s</a></li>') % ( |
380 | 380 |
qs, _('Excel Export')) |
381 |
- |