@@ -0,0 +1,932 @@
+%22%22%22%0A:Copyright: 2006-2020 Jochen Kupperschmidt%0A:License: Modified BSD, see LICENSE for details.%0A%22%22%22%0A%0Afrom datetime import datetime, timedelta%0A%0Afrom freezegun import freeze_time%0Aimport pytest%0A%0Afrom byceps.services.party.transfer.models import Party%0A%0A%0A@pytest.mark.parametrize('now, expected', %5B%0A    (datetime(2020,  3,  21, 14, 59, 59), False),%0A    (datetime(2020,  3,  21, 15,  0,  0), False),%0A    (datetime(2020,  3,  21, 15,  0,  1), True),%0A%5D)%0Adef test_is_over(now, expected):%0A    ends_at = datetime(2020, 3, 21, 15, 0 ,0)%0A    party = create_party(ends_at)%0A%0A    with freeze_time(now):%0A        assert party.is_over == expected%0A%0A%0A# helpers%0A%0A%0Adef create_party(ends_at: datetime) -%3E Party:%0A    starts_at = ends_at - timedelta(days=2)%0A    return Party(%0A        'anylan-20',%0A        'anylan',%0A        'AnyLAN #20',%0A        starts_at,%0A        ends_at,%0A        0,%0A        'any-shop-id',%0A        False,%0A        False,%0A        False,%0A    )%0A

Test `Party.is_over` property