"""Test DELETE /profile/profile_id//profile_type/ endpoint.""" import uuid import requests from tests.integration import config def test_delete_profile(new_profile, grass_headers): """Test deleting a profile.""" profile_id = new_profile['profile_id'] profile_type = new_profile['profile_type'] res = requests.delete( f'{config.QA_BASE_URL}/profile/profile_id/{profile_id}/profile_type/{profile_type}', headers=grass_headers, ) assert res.status_code == 204 # Try and fetch it... 🦴 res = requests.get( f'{config.QA_BASE_URL}/profile/profile_id/{profile_id}/profile_type/{profile_type}', headers=grass_headers, ) assert res.status_code == 404 def test_delete_nonexistent_profile(grass_headers): """Test attempting to delete a nonexistent profile.""" profile_id = uuid.uuid4() profile_type = 'InsightsProfile' res = requests.delete( f'{config.QA_BASE_URL}/profile/profile_id/{profile_id}/profile_type/{profile_type}', headers=grass_headers, ) assert res.status_code == 404 body = res.json() assert body['code'] == 'not_found_error' assert body['message'] == 'Profile not found'