Merge pull request #3222 from alphagov/fix-days-provider-history

Fix off-by-one dates on provider history
This commit is contained in:
Chris Hill-Scott
2019-12-13 13:29:56 +00:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -51,7 +51,7 @@
{% for day, versions in versions %}
<h2 class="heading-small top-gutter">
{% if day %}
{{ day|format_date_human|title }}
{{ versions[0]['updated_at']|format_date_human|title }}
{% else %}
Start
{% endif %}

View File

@@ -6,6 +6,7 @@ from unittest.mock import call
import pytest
from bs4 import BeautifulSoup
from flask import url_for
from freezegun import freeze_time
import app
from app.main.views.providers import add_monthly_traffic
@@ -409,6 +410,7 @@ def test_should_show_provider_version_history(
assert second_row[4].text.strip() == "True"
@freeze_time('2022-2-22 15:00')
def test_should_show_version_history_for_first_two_sms_providers(
client_request,
platform_admin_user,
@@ -473,8 +475,8 @@ def test_should_show_version_history_for_first_two_sms_providers(
for heading in page.select('main h2')
] == [
'Now',
'21 February 2022',
'31 December',
'Today',
'1 January 2020',
]
assert [