Skip to content
Snippets Groups Projects
Commit 1b5563eb authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Add test

parent 30942148
No related branches found
No related tags found
1 merge request!1708Resolve "All-day events with same start/end date aren't handled correctly"
Pipeline #195793 failed
import base64
from datetime import date
from django.contrib.auth import get_user_model
from django.test import override_settings
......@@ -6,7 +7,7 @@ from django.urls import reverse
import pytest
from aleksis.core.models import Group, OAuthApplication, Person
from aleksis.core.models import Holiday, Group, OAuthApplication, Person
pytestmark = pytest.mark.django_db
......@@ -147,3 +148,16 @@ def test_change_password_not_logged_in(client):
assert response.status_code == 200
assert "Please login to see this page." in response.content.decode("utf-8")
def test_all_day_events_end_date():
"""Tests that CalendarEvent's value method returns a non-inclusive end date for all day events.
https://edugit.org/AlekSIS/official/AlekSIS-Core/-/issues/1199
"""
holiday = Holiday.objects.create(
date_start=date(2024, 2, 1), date_end=date(2024, 2, 1), holiday_name="Test Holiday"
)
assert holiday.value_start_datetime(holiday) == date(2024, 2, 1)
assert holiday.value_end_datetime(holiday) == date(2024, 2, 2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment