fix: Praktikum mit 6h wird wie ganz normaler Tag gewertet und mit Pauschale versehen

This commit is contained in:
Rob committed 2026-05-21 23:24:22 +02:00
1 parent 0d5620ae89
commit 7d82aeb0f5
3 files changed
+47 -4

No files matched your search

+23 -3
View File
@@ -128,21 +128,30 @@ class TestAbsentDay:
fields = build_field_dict(_make_attendance(_absent(4, status)), cfg, date(2026, 2, 1))
assert fields["anwesend.0"] == status
@pytest.mark.parametrize("status", ["K", "KK", "E", "F", "P", "U"])
@pytest.mark.parametrize("status", ["K", "KK", "E", "F", "U"])
def test_ist_empty(self, cfg, status):
fields = build_field_dict(_make_attendance(_absent(4, status)), cfg, date(2026, 2, 1))
assert fields["ist.0"] == ""
@pytest.mark.parametrize("status", ["K", "KK", "E", "F", "P", "U"])
@pytest.mark.parametrize("status", ["K", "KK", "E", "F", "U"])
def test_plan_empty(self, cfg, status):
fields = build_field_dict(_make_attendance(_absent(4, status)), cfg, date(2026, 2, 1))
assert fields["plan.0"] == ""
@pytest.mark.parametrize("status", ["K", "KK", "E", "F", "P", "U"])
@pytest.mark.parametrize("status", ["K", "KK", "E", "F", "U"])
def test_pauschale_empty(self, cfg, status):
fields = build_field_dict(_make_attendance(_absent(4, status)), cfg, date(2026, 2, 1))
assert fields["pauschale_5.0"] == "0"
def test_praktikum_sets_fixed_hours(self, cfg):
fields = build_field_dict(_make_attendance(_absent(4, "P")), cfg, date(2026, 2, 1))
assert fields["ist.0"] == "6,00"
assert fields["plan.0"] == "6"
def test_praktikum_sets_pauschale(self, cfg):
fields = build_field_dict(_make_attendance(_absent(4, "P")), cfg, date(2026, 2, 1))
assert fields["pauschale_5.0"] == "1"
# ---------------------------------------------------------------------------
# Multi-row indexing
@@ -177,6 +186,17 @@ class TestSummaryFields:
# Day 1 (6h) and day 2 (7h) qualify, day 3 (5h) does not
assert fields["anwesend_sum"] == "2"
def test_anwesend_sum_counts_praktikum_as_6h(self, cfg):
entries = [_present(1, 6.0), _absent(2, "P"), _present(3, 5.0)]
fields = build_field_dict(_make_attendance(*entries), cfg, date(2026, 2, 1))
assert fields["anwesend_sum"] == "2"
def test_praktikum_increases_pauschale_sum(self, cfg):
entries = [_absent(1, "P")]
fields = build_field_dict(_make_attendance(*entries), cfg, date(2026, 2, 1))
assert fields["pauschale_5_sum"] == "8.60"
assert fields["pauschale_sum"] == "8.60"
def test_pauschale_5_sum_euro(self, cfg):
"""pauschale_5_sum = qualifying days * 8.60 (period decimal for JS)."""
entries = [_present(1, 6.0), _present(2, 7.0), _present(3, 5.0)]