def test_complete_task_does_nothing_when_task_is_already_completed():
    completed_at = date(2020, 12, 31)
    task = Task(name="Foo", completed_at=completed_at)

    task.complete(at=date(2021, 1, 17))

    assert task.completed_at == completed_at
def test_complete_task_sets_completed_at():
    task = Task(name="Foo")
    now = date(2020, 12, 31)

    task.complete(at=now)

    assert task.completed_at is not None
    assert task.completed_at == now