From 0f21c97f06bccd2260931e7543a24dc618f355b4 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 18 May 2021 20:26:07 +0100 Subject: fixed test related to getting the correct year from a Month() --- datamaps/tests/test_api.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'datamaps/tests/test_api.py') diff --git a/datamaps/tests/test_api.py b/datamaps/tests/test_api.py index 4c73931..295f1fb 100644 --- a/datamaps/tests/test_api.py +++ b/datamaps/tests/test_api.py @@ -18,6 +18,7 @@ def test_get_project_data_using_month(master): m2 = project_data_from_master_month(master, 8, 2021) m3 = project_data_from_master_month(master, 9, 2021) m4 = project_data_from_master_month(master, 10, 2021) + m5 = project_data_from_master_month(master, 2, 2021) # this is q4 assert m["Chutney Bridge.xlsm"]["Project/Programme Name"] == "Chutney Bridge Ltd" assert isinstance(m.month, Month) assert m.month.name == "July" @@ -32,3 +33,9 @@ def test_get_project_data_using_month(master): assert m2.quarter.end_date == datetime.date(2021, 9, 30) assert m3.quarter.end_date == datetime.date(2021, 9, 30) assert m4.quarter.end_date == datetime.date(2021, 12, 31) + + # year should be different if using this func + assert m.year == 2021 + assert m2.year == 2021 + assert m3.year == 2021 + assert m5.year == 2021 -- cgit v1.2.3