aboutsummaryrefslogtreecommitdiffstats
path: root/datamaps/tests
diff options
context:
space:
mode:
Diffstat (limited to 'datamaps/tests')
-rw-r--r--datamaps/tests/test_api.py7
-rw-r--r--datamaps/tests/test_month.py1
2 files changed, 8 insertions, 0 deletions
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
diff --git a/datamaps/tests/test_month.py b/datamaps/tests/test_month.py
index a533cd0..de53545 100644
--- a/datamaps/tests/test_month.py
+++ b/datamaps/tests/test_month.py
@@ -30,6 +30,7 @@ def test_quarter_objects_have_months():
def test_month():
m1 = Month(1, 2021)
assert m1.name == "January"
+ assert m1.year == 2021
m2 = Month(9, 2021)
assert m2.name == "September"
assert m2.start_date == datetime.date(2021, 9, 1)