backoffice: always use <th> for table head cells (#14500)
This commit is contained in:
parent
df1977f2dc
commit
f0b01aa92f
|
@ -394,11 +394,11 @@ def test_backoffice_columns(pub):
|
|||
create_environment(pub)
|
||||
app = login(get_app(pub))
|
||||
resp = app.get('/backoffice/management/form-title/')
|
||||
assert resp.body.count('</th>') == 6 # five columns
|
||||
assert resp.body.count('</th>') == 7 # five columns
|
||||
resp.forms[0]['1'].checked = False
|
||||
assert not 'submission_channel' in resp.forms[0].fields
|
||||
resp = resp.forms[0].submit()
|
||||
assert resp.body.count('</th>') == 5 # four columns
|
||||
assert resp.body.count('</th>') == 6 # four columns
|
||||
assert resp.body.count('data-link') == 17 # 17 rows
|
||||
assert resp.body.count('FOO BAR') == 0 # no field 1 column
|
||||
|
||||
|
@ -414,10 +414,10 @@ def test_backoffice_channel_column(pub):
|
|||
create_environment(pub)
|
||||
app = login(get_app(pub))
|
||||
resp = app.get('/backoffice/management/form-title/')
|
||||
assert resp.body.count('</th>') == 6 # five columns
|
||||
assert resp.body.count('</th>') == 7 # five columns
|
||||
resp.forms[0]['submission_channel'].checked = True
|
||||
resp = resp.forms[0].submit()
|
||||
assert resp.body.count('</th>') == 7 # six columns
|
||||
assert resp.body.count('</th>') == 8 # six columns
|
||||
assert resp.body.count('data-link') == 17 # 17 rows
|
||||
assert resp.body.count('<td>Web</td>') == 17
|
||||
|
||||
|
@ -436,10 +436,10 @@ def test_backoffice_submission_agent_column(pub):
|
|||
formdef.backoffice_submission_roles = user.roles
|
||||
formdef.store()
|
||||
resp = app.get('/backoffice/management/form-title/')
|
||||
assert resp.body.count('</th>') == 6 # five columns
|
||||
assert resp.body.count('</th>') == 7 # five columns
|
||||
resp.form['submission_agent'].checked = True
|
||||
resp = resp.form.submit()
|
||||
assert resp.body.count('</th>') == 7 # six columns
|
||||
assert resp.body.count('</th>') == 8 # six columns
|
||||
assert resp.body.count('data-link') == 17 # 17 rows
|
||||
assert not '>agent<' in resp.body
|
||||
resp = resp.click('Export as CSV File')
|
||||
|
|
|
@ -82,7 +82,7 @@ class FormDefUI(object):
|
|||
if include_criticality_level and self.formdef.workflow.criticality_levels and using_postgresql:
|
||||
r += htmltext('<th style="width: 4ex;" data-field-sort-key="criticality_level"><span></span></th>')
|
||||
else:
|
||||
r += htmltext('<td></td>') # lock
|
||||
r += htmltext('<th></th>') # lock
|
||||
for f in fields:
|
||||
field_sort_key = None
|
||||
if getattr(f, 'fake', False):
|
||||
|
|
Loading…
Reference in New Issue