tests: add check of afterjob status page

This commit is contained in:
Frédéric Péters 2017-06-18 11:27:42 +02:00
parent ab28fdfc93
commit 05f25c55a9
1 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import StringIO
import time
import hashlib
import random
import urlparse
import xml.etree.ElementTree as ET
import zipfile
@ -731,11 +732,19 @@ def test_backoffice_export_long_listings(pub):
resp = app.get('/backoffice/management/form-title/')
resp = resp.click('Export a Spreadsheet')
assert resp.location.startswith('http://example.net/backoffice/management/form-title/export?job=')
job_id = urlparse.parse_qs(urlparse.urlparse(resp.location).query)['job'][0]
resp = resp.follow()
assert 'completed' in resp.body
resp = resp.click('Download Export')
assert resp.content_type == 'application/vnd.oasis.opendocument.spreadsheet'
# check afterjob ajax call
status_resp = app.get('/afterjobs/' + job_id)
assert status_resp.body == 'completed|completed'
# check error handling
app.get('/afterjobs/whatever', status=404)
def test_backoffice_csv_export_channel(pub):
if not pub.site_options.has_section('variables'):
pub.site_options.add_section('variables')