@@ -50,7 +50,10 @@ def test_amplitude_create_list__valid_key__creates_amplitude_cohort(
5050
5151 # Then
5252 assert response .status_code == status .HTTP_200_OK
53- cohort = Cohort .objects .get (uuid = response .json ()["listId" ])
53+ cohort = Cohort .objects .get (uuid = response .json ()["list_id" ])
54+ # Amplitude's production worker reads the nested copy, its Testing tab
55+ # the flat one.
56+ assert response .json ()["response" ]["list_id" ] == response .json ()["list_id" ]
5457 assert cohort .environment == key .environment
5558 assert cohort .source_type == CohortSourceType .AMPLITUDE
5659 assert cohort .segment .name == "[Amplitude] Beta users: 1234"
@@ -74,7 +77,7 @@ def test_amplitude_create_list__postgres_environment__creates_cohort(
7477
7578 # Then
7679 assert response .status_code == status .HTTP_200_OK
77- cohort = Cohort .objects .get (uuid = response .json ()["listId " ])
80+ cohort = Cohort .objects .get (uuid = response .json ()["list_id " ])
7881 assert cohort .environment == environment
7982
8083
@@ -350,7 +353,7 @@ def test_amplitude_create_list__valid_key__audits_and_queues_environment_update(
350353 # Then - the audit record carries no user, names the source, and is the
351354 # hook that rebuilds the environment document.
352355 assert response .status_code == status .HTTP_200_OK
353- cohort = Cohort .objects .get (uuid = response .json ()["listId " ])
356+ cohort = Cohort .objects .get (uuid = response .json ()["list_id " ])
354357 audit_log = AuditLog .objects .get (related_object_id = cohort .segment_id )
355358 assert audit_log .author is None
356359 assert audit_log .master_api_key is None
@@ -377,7 +380,7 @@ def test_amplitude_create_list__valid_key__history_records_no_user(
377380 # Then - a machine caller leaves no user on historical records; stamping
378381 # one would fail, since the sync key is not a Flagsmith user.
379382 assert response .status_code == status .HTTP_200_OK
380- cohort = Cohort .objects .get (uuid = response .json ()["listId " ])
383+ cohort = Cohort .objects .get (uuid = response .json ()["list_id " ])
381384 history_record = cohort .segment .history .get ()
382385 assert history_record .history_user is None
383386 assert history_record .master_api_key is None
0 commit comments