Skip to content

Commit

Permalink
FIX: FR Stories/files from scheduled output function is not generated…
Browse files Browse the repository at this point in the history
… correctly according to template [SDCP-895] (#386)

* FIX: FR Stories/files from scheduled output function is not generated correctly according to template [SDCP-895]

* update tests
  • Loading branch information
devketanpro authored Dec 30, 2024
1 parent 3fe09b7 commit eac0caf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
6 changes: 3 additions & 3 deletions server/templates/french_news_events_list_export.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
{%- if items -%}
<p><b>{{ group }}</b></p>
{%- for item in items -%}
<p><b>{{ item.title }}</b><br>
<p><b>{{ item.title }}<br></b>
{%- if item.coverage_types -%}
COUVERTURE: {{ item.coverage_types }}.<br>
{%- endif -%}
{%- if item.address.city -%}
{{ item.address.city }} - {{ item.local_time }}. {{ item.address.short }}.
{{ item.address.city }} - {{ item.local_time }}. {{ item.address.short }}.<br>
{%- else -%}
{{ item.local_time }}.
{{ item.local_time }}.<br>
{%- endif -%}
{%- if item.description_short -%}
<br>{{ item.description_short }}
Expand Down
23 changes: 22 additions & 1 deletion server/templates/news_events_list_export.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,28 @@ <h2>{{ date_group.name }}</h2>
{% if items %}
<p><b>{{ group }}</b></p>
{% for item in items %}
<p>{{ item.title }}<br>{{ item.address.name }} {{ item.description }}{{ item.formatted_time }}{{ item.address.full }}{{ item.coverage_types }}</p>
<p>{{ item.title }}<br>

{%- if item.address.name -%}
{{ item.address.name }}<br>
{%- endif -%}

{%- if item.description -%}
{{ item.description }}<br>
{%- endif -%}

{%- if item.formatted_time -%}
{{ item.formatted_time }}<br>
{%- endif -%}

{%- if item.address.full -%}
{{ item.address.full }}<br>
{%- endif -%}

{%- if item.coverage_types -%}
{{ item.coverage_types }}<br>
{%- endif -%}
</p>
{% endfor %}
{% endif %}
{% endfor %}
Expand Down
11 changes: 6 additions & 5 deletions server/tests/planning_export/planning_export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from flask import render_template
from app import get_app


events = [
{
"type": "event",
Expand Down Expand Up @@ -90,22 +91,22 @@ def test_new_one(self):
"news_events_list_export.html", items=events, app=self.app
)
self.assertIn(
"<p>First<br> 06:30 AM 2024-04-22 - 11:30 AM 2024-04-24</p>",
"<p>First<br>06:30 AM 2024-04-22 - 11:30 AM 2024-04-24<br></p>",
template_data,
)
self.assertIn(
"<p>third<br> 08:00 PM 2024-07-19</p>",
"<p>third<br>08:00 PM 2024-07-19<br></p>",
template_data,
)
self.assertIn(
"<p>second<br> 2024-07-20</p>",
"<p>second<br>2024-07-20<br></p>",
template_data,
)
self.assertIn(
"<p>fourth<br> 06:30 AM 2024-04-22 - 2024-04-24</p>",
"<p>fourth<br>06:30 AM 2024-04-22 - 2024-04-24<br></p>",
template_data,
)
self.assertIn(
"<p>fifth<br> 06:30 AM 2024-04-22</p>",
"<p>fifth<br>06:30 AM 2024-04-22<br></p>",
template_data,
)

0 comments on commit eac0caf

Please sign in to comment.