def METHOD_NAME(app):
    """
    When an app is built
        and CSRF ext is applied
            it should expose a new endpoint /csrf
            when a csrf cookie is not set in the incoming request
              it should set a new csrf cookie
              it should return the csrf_token in a json
    """
    CSRF(app)
    now = datetime.datetime.utcnow()
    expected_expiration = (now + datetime.timedelta(seconds=30)).strftime('%a, %d %b %Y %H:%M:%S')
    resp = app.test_client().get('/csrf')
    csrf_cookies = list(cookie_value for cookie_header, cookie_value in resp.headers if
                        'Set-Cookie' in cookie_header and CSRF_COOKIE_NAME in cookie_value)
    assert resp.status_code != 405
    assert 'csrf_token' in resp.json
    assert len(csrf_cookies) > 0
    assert 'Secure; HttpOnly; Path=/; SameSite=Lax' in csrf_cookies[0]
    assert f'Expires={expected_expiration}' in csrf_cookies[0]