fix: include admin in personal payout fallback
This commit is contained in:
@@ -3,7 +3,7 @@ from __future__ import annotations
|
||||
from decimal import Decimal
|
||||
|
||||
from app.extensions import db
|
||||
from app.models import Account, AllocationSuggestion, Month
|
||||
from app.models import Account, AllocationSuggestion, Month, User
|
||||
from app.utils.users import personal_account_names
|
||||
|
||||
|
||||
@@ -169,3 +169,14 @@ def test_seeded_distribution_entries_are_marked_as_allocation_targets(app):
|
||||
assert target_entries["Freizeitbudget"] is True
|
||||
assert target_entries["Person 1"] is True
|
||||
assert target_entries["Person 2"] is True
|
||||
|
||||
|
||||
def test_personal_account_names_fill_with_admin_if_only_one_editor_is_active(app):
|
||||
editor_b = User.query.filter_by(username="mitglied2").first()
|
||||
editor_b.is_active = False
|
||||
db.session.commit()
|
||||
|
||||
personal_labels = personal_account_names()
|
||||
|
||||
assert personal_labels["persoenlich-flo"] == "Person A"
|
||||
assert personal_labels["persoenlich-desi"] == "Admin"
|
||||
|
||||
Reference in New Issue
Block a user