def METHOD_NAME():
    """Test that the ctftime function prevents accessing challenges after the ctf"""
    app = create_ctfd()
    with app.app_context():
        with ctftime.init():
            register_user(app)
            chal = gen_challenge(app.db)
            chal_id = chal.id
            gen_flag(app.db, challenge_id=chal.id, content="flag")
            with ctftime.ended():
                client = login_as_user(app)
                r = client.get("/challenges")
                assert r.status_code == 403
                with client.session_transaction() as sess:
                    data = {
                        "submission": "flag",
                        "challenge_id": chal_id,
                        "nonce": sess.get("nonce"),
                    }
                r = client.post("/api/v1/challenges/attempt", data=data)
                assert r.status_code == 403
            solve_count = app.db.session.query(app.db.func.count(Solves.id)).first()[0]
            assert solve_count == 0
    destroy_ctfd(app)