# ... moved and adapted code from test_phase2_endpoints.py ...