diff options
author | Daniel Schadt <kingdread@gmx.de> | 2024-11-28 21:28:51 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2024-11-28 21:28:51 +0100 |
commit | 880ba034082ebc288066f3c1ac54d8d5a3550123 (patch) | |
tree | 49f6e8f1be0ab3b78e0d4a7c4c852be1097da0f6 /tests/unit/views/test_profile.py | |
parent | 5866345dd92ffa5c0b41b5b13f16f1900075f4a6 (diff) | |
parent | e82233c57ba2a76dd2fbe10cec8effceac2a3e75 (diff) | |
download | fietsboek-880ba034082ebc288066f3c1ac54d8d5a3550123.tar.gz fietsboek-880ba034082ebc288066f3c1ac54d8d5a3550123.tar.bz2 fietsboek-880ba034082ebc288066f3c1ac54d8d5a3550123.zip |
Merge branch 'calendar'
Diffstat (limited to 'tests/unit/views/test_profile.py')
-rw-r--r-- | tests/unit/views/test_profile.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/views/test_profile.py b/tests/unit/views/test_profile.py new file mode 100644 index 0000000..bc8e794 --- /dev/null +++ b/tests/unit/views/test_profile.py @@ -0,0 +1,21 @@ +import pytest +import datetime + +from fietsboek.views import profile + + +@pytest.mark.parametrize("current, prev_month, next_month", [ + ((2024, 2, 1), (2024, 1, 1), (2024, 3, 1)), + ((2024, 1, 1), (2023, 12, 1), (2024, 2, 1)), + ((2024, 12, 1), (2024, 11, 1), (2025, 1, 1)), + ((2024, 5, 5), (2024, 4, 1), (2024, 6, 1)), + ((2024, 7, 31), (2024, 6, 1), (2024, 8, 1)), +]) +def test_prev_next_month(current, prev_month, next_month): + current = datetime.date(*current) + prev_month = datetime.date(*prev_month) + next_month = datetime.date(*next_month) + + actual_prev, actual_next = profile.prev_next_month(current) + assert actual_prev == prev_month + assert actual_next == next_month |