From 8cea25233121243091418330eca781d81a35b9e8 Mon Sep 17 00:00:00 2001 From: Dhruv Bhanushali Date: Mon, 24 Jun 2024 18:14:27 +0400 Subject: [PATCH] Update tests to account for media items being deleted --- .../management/commands/test_backfillmoderationdecision.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/test/unit/management/commands/test_backfillmoderationdecision.py b/api/test/unit/management/commands/test_backfillmoderationdecision.py index 9c6e517dd91..4c4e91cc88d 100644 --- a/api/test/unit/management/commands/test_backfillmoderationdecision.py +++ b/api/test/unit/management/commands/test_backfillmoderationdecision.py @@ -78,12 +78,13 @@ def test_create_moderation_decision_for_reports( assert f"Created 1 {media_type} moderation decisions from existing reports." in out decision = MediaDecision.objects.first() - assert decision.media_objs.count() == 1 assert decision.action == expected_action assert decision.moderator.username == username + assert MediaDecisionThrough.objects.filter(decision=decision).count() == 1 + decision_through = MediaDecisionThrough.objects.first() - assert decision_through.media_obj == report.media_obj + assert str(decision_through.media_obj_id) == report.media_obj_id assert decision_through.decision == decision