def test_ctf_ended():
    """
    Tests that the ctf_ended function returns the correct value
    """
    app = create_ctfd()
    with app.app_context():
        assert ctf_ended() is False
        with ctftime.init():

            with ctftime.not_started():
                assert ctf_ended() is False

            with ctftime.started():
                assert ctf_ended() is False

            with ctftime.ended():
                assert ctf_ended() is True
    destroy_ctfd(app)

    Tests that the ctf_ended function returns the correct value
    
tests/utils/test_ctftime.py