From 6f2bc5ef58a588ad5d909ff0490465b140574efd Mon Sep 17 00:00:00 2001 From: tberey Date: Mon, 8 Aug 2022 13:39:42 +0100 Subject: [PATCH 1/2] Update Banner for new framework information and link to live dates. Always enable banner temporarily. Updates tests for enabled banner, when framework is not live --- dmutils/dmp_so_status.py | 4 ++-- tests/test_dmp_so_status.py | 40 +++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/dmutils/dmp_so_status.py b/dmutils/dmp_so_status.py index 6108e282..08f086f9 100644 --- a/dmutils/dmp_so_status.py +++ b/dmutils/dmp_so_status.py @@ -4,5 +4,5 @@ G13_CLOSE = datetime(2022, 5, 18, 15, 0, 0) -def are_new_frameworks_live(params) -> bool: - return G13_OPEN <= datetime.now() <= G13_CLOSE or params.get('show_dmp_so_banner') == 'true' +def are_new_frameworks_live(_params) -> bool: + return True diff --git a/tests/test_dmp_so_status.py b/tests/test_dmp_so_status.py index 69e1fe7e..e7f7dfaf 100644 --- a/tests/test_dmp_so_status.py +++ b/tests/test_dmp_so_status.py @@ -1,33 +1,35 @@ -from freezegun import freeze_time +# from freezegun import freeze_time from dmutils.dmp_so_status import are_new_frameworks_live +def test_should_be_true(): + assert are_new_frameworks_live({}) is True -@freeze_time('2022-03-08') -def test_should_be_false_if_before_go_live_date(): - assert are_new_frameworks_live({}) is False +# @freeze_time('2022-03-08') +# def test_should_be_false_if_before_go_live_date(): +# assert are_new_frameworks_live({}) is False -@freeze_time('2022-03-09 12:00:01') -def test_should_be_true_if_on_go_live_date(): - assert are_new_frameworks_live({}) is True +# @freeze_time('2022-03-09 12:00:01') +# def test_should_be_true_if_on_go_live_date(): +# assert are_new_frameworks_live({}) is True -@freeze_time('2022-03-10') -def test_should_be_true_if_after_go_live_date(): - assert are_new_frameworks_live({}) is True +# @freeze_time('2022-03-10') +# def test_should_be_true_if_after_go_live_date(): +# assert are_new_frameworks_live({}) is True -@freeze_time('2022-03-08') -def test_should_be_true_if_before_date_and_go_live_param(): - assert are_new_frameworks_live({'show_dmp_so_banner': 'true'}) is True +# @freeze_time('2022-03-08') +# def test_should_be_true_if_before_date_and_go_live_param(): +# assert are_new_frameworks_live({'show_dmp_so_banner': 'true'}) is True -@freeze_time('2022-03-08') -def test_should_be_false_if_before_date_and_not_go_live_param(): - assert are_new_frameworks_live({'show_dmp_1.0_banner': 'true'}) is False +# @freeze_time('2022-03-08') +# def test_should_be_false_if_before_date_and_not_go_live_param(): +# assert are_new_frameworks_live({'show_dmp_1.0_banner': 'true'}) is False -@freeze_time('2022-05-18 15:00:01') -def test_should_be_false_after_g13_closes(): - assert are_new_frameworks_live({'show_dmp_1.0_banner': 'true'}) is False +# @freeze_time('2022-05-18 15:00:01') +# def test_should_be_false_after_g13_closes(): +# assert are_new_frameworks_live({'show_dmp_1.0_banner': 'true'}) is False From 41e031aafd783fa8a784e7d81921ef91144e4c2f Mon Sep 17 00:00:00 2001 From: tberey Date: Mon, 8 Aug 2022 13:41:44 +0100 Subject: [PATCH 2/2] Update Banner for new framework information and link to live dates. Always enable banner temporarily. Updates tests for enabled banner, when framework is not live --- dmutils/__init__.py | 2 +- dmutils/dmp_so_status.py | 1 + tests/test_dmp_so_status.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dmutils/__init__.py b/dmutils/__init__.py index 2c12c51f..be6c9b1f 100644 --- a/dmutils/__init__.py +++ b/dmutils/__init__.py @@ -2,4 +2,4 @@ from .flask_init import init_app -__version__ = '60.8.1' +__version__ = '60.9.0' diff --git a/dmutils/dmp_so_status.py b/dmutils/dmp_so_status.py index 08f086f9..9bac699c 100644 --- a/dmutils/dmp_so_status.py +++ b/dmutils/dmp_so_status.py @@ -5,4 +5,5 @@ def are_new_frameworks_live(_params) -> bool: + # return G13_OPEN <= datetime.now() <= G13_CLOSE or params.get('show_dmp_so_banner') == 'true' return True diff --git a/tests/test_dmp_so_status.py b/tests/test_dmp_so_status.py index e7f7dfaf..c8f94bf2 100644 --- a/tests/test_dmp_so_status.py +++ b/tests/test_dmp_so_status.py @@ -2,6 +2,7 @@ from dmutils.dmp_so_status import are_new_frameworks_live + def test_should_be_true(): assert are_new_frameworks_live({}) is True