mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-08 10:28:57 -04:00
Only print the id attribute if it’s a string
If it’s something weird like an instance of a Python object let’s ignore it (else we get invalid HTML like `id='<notifications_utils.columns.Cell object at 0x1126f4e80>'`).
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro row(id=None) -%}
|
||||
<tr class="table-row" {% if id %}id="{{id}}"{% endif %}>
|
||||
<tr class="table-row" {% if id and id is string %}id="{{id}}"{% endif %}>
|
||||
{{ caller() }}
|
||||
</tr>
|
||||
{%- endmacro %}
|
||||
|
||||
@@ -704,6 +704,7 @@ def test_upload_valid_csv_shows_preview_and_table(
|
||||
]):
|
||||
for index, cell in enumerate(row):
|
||||
row = page.select('table tbody tr')[row_index]
|
||||
assert 'id' not in row
|
||||
assert normalize_spaces(str(row.select('td')[index + 1])) == cell
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user