Skip to content

Commit

Permalink
Merge pull request #793 from Crown-Commercial-Service/Update-Banner-a…
Browse files Browse the repository at this point in the history
…nd-Tests

Update banner and tests
  • Loading branch information
tberey authored Aug 9, 2022
2 parents e2ced51 + 41e031a commit 5aa8f55
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dmutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from .flask_init import init_app


__version__ = '60.8.1'
__version__ = '60.9.0'
5 changes: 3 additions & 2 deletions dmutils/dmp_so_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
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 G13_OPEN <= datetime.now() <= G13_CLOSE or params.get('show_dmp_so_banner') == 'true'
return True
41 changes: 22 additions & 19 deletions tests/test_dmp_so_status.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
from freezegun import freeze_time
# from freezegun import freeze_time

from dmutils.dmp_so_status import are_new_frameworks_live


@freeze_time('2022-03-08')
def test_should_be_false_if_before_go_live_date():
assert are_new_frameworks_live({}) is False
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-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

0 comments on commit 5aa8f55

Please sign in to comment.