@@ -50,16 +50,7 @@ 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 ()["list_id" ])
54- # Amplitude's test and production parsers read the ID under different
55- # keys and depths; every copy must be present.
56- body = response .json ()
57- assert (
58- body ["listId" ]
59- == body ["response" ]["list_id" ]
60- == body ["response" ]["listId" ]
61- == body ["list_id" ]
62- )
53+ cohort = Cohort .objects .get (uuid = response .json ()["listId" ])
6354 assert cohort .environment == key .environment
6455 assert cohort .source_type == CohortSourceType .AMPLITUDE
6556 assert cohort .segment .name == "[Amplitude] Beta users: 1234"
@@ -83,7 +74,7 @@ def test_amplitude_create_list__postgres_environment__creates_cohort(
8374
8475 # Then
8576 assert response .status_code == status .HTTP_200_OK
86- cohort = Cohort .objects .get (uuid = response .json ()["list_id " ])
77+ cohort = Cohort .objects .get (uuid = response .json ()["listId " ])
8778 assert cohort .environment == environment
8879
8980
@@ -359,7 +350,7 @@ def test_amplitude_create_list__valid_key__audits_and_queues_environment_update(
359350 # Then - the audit record carries no user, names the source, and is the
360351 # hook that rebuilds the environment document.
361352 assert response .status_code == status .HTTP_200_OK
362- cohort = Cohort .objects .get (uuid = response .json ()["list_id " ])
353+ cohort = Cohort .objects .get (uuid = response .json ()["listId " ])
363354 audit_log = AuditLog .objects .get (related_object_id = cohort .segment_id )
364355 assert audit_log .author is None
365356 assert audit_log .master_api_key is None
@@ -386,7 +377,7 @@ def test_amplitude_create_list__valid_key__history_records_no_user(
386377 # Then - a machine caller leaves no user on historical records; stamping
387378 # one would fail, since the sync key is not a Flagsmith user.
388379 assert response .status_code == status .HTTP_200_OK
389- cohort = Cohort .objects .get (uuid = response .json ()["list_id " ])
380+ cohort = Cohort .objects .get (uuid = response .json ()["listId " ])
390381 history_record = cohort .segment .history .get ()
391382 assert history_record .history_user is None
392383 assert history_record .master_api_key is None
0 commit comments