From a05e09d3452cbb95221a0c47672281efa9bee3ba Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Thu, 14 Mar 2024 11:02:02 -0700 Subject: [PATCH] fixed testing --- app/templates/views/check/preview.html | 44 ++++++++++---------------- tests/app/main/views/test_send.py | 18 +++++------ 2 files changed, 25 insertions(+), 37 deletions(-) diff --git a/app/templates/views/check/preview.html b/app/templates/views/check/preview.html index 86b173677..ea7978ebe 100644 --- a/app/templates/views/check/preview.html +++ b/app/templates/views/check/preview.html @@ -42,25 +42,6 @@
- {% for column in recipients.column_headers %} {% endfor %} {% if item[None].data %} {% for column in item[None].data %} - + {% endfor %} {% endif %} diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 35309f57f..949852824 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -975,11 +975,11 @@ def test_upload_valid_csv_shows_preview_and_table( for row_index, row in enumerate( [ ( - '', - '', + '', + '', ( '', - '', + '', + '', ( '', - '', + '', + '', ( '
Note: Only the first 5 rows are displayed here. @@ -79,22 +60,29 @@
-
- {% if item[column].ignore %} - {{ item[column].data or '' }} +
+ {% set column_data = item[column].data or '' %} + {% if column_data is iterable and column_data is not string %} +
    + {% for data_item in column_data %} + {% if data_item is not none %} +
  • {{ data_item }}
  • + {% endif %} + {% endfor %} +
{% else %} - {{ item[column].data or '' }} + {{ column_data }} {% endif %}
-
- {{ column }} -
-
+
+ {{ column }} +
+
2028675301
A
2028675301
A
' - '
' + '
' "
    " "
  • foo
  • foo
  • foo
  • " "
" @@ -988,11 +988,11 @@ def test_upload_valid_csv_shows_preview_and_table( ), ), ( - '
2028675302
B
2028675302
B
' - '
' + '
' "
    " "
  • foo
  • foo
  • foo
  • " "
" @@ -1001,11 +1001,11 @@ def test_upload_valid_csv_shows_preview_and_table( ), ), ( - '
2028675303
C
2028675303
C
' - '
' + '
' "
    " "
  • foo
  • foo
  • " "
"