|
@@ -1427,6 +1427,29 @@ class CreativeRejectionCleanupTests(unittest.TestCase):
|
|
|
self.assertEqual(outcome["status"], "SENT")
|
|
self.assertEqual(outcome["status"], "SENT")
|
|
|
self.assertEqual(update.call_args.kwargs["status"], "SENT")
|
|
self.assertEqual(update.call_args.kwargs["status"], "SENT")
|
|
|
|
|
|
|
|
|
|
+ def test_operator_summary_chat_uses_ad_project_group(self):
|
|
|
|
|
+ from tools import creative_rejection_cleanup as cleanup
|
|
|
|
|
+
|
|
|
|
|
+ with patch.dict(
|
|
|
|
|
+ os.environ,
|
|
|
|
|
+ {
|
|
|
|
|
+ "FEISHU_OPERATOR_CHAT_ID": "chat-operator",
|
|
|
|
|
+ "FEISHU_AD_PROJECT_CHAT_ID": "chat-project",
|
|
|
|
|
+ },
|
|
|
|
|
+ clear=False,
|
|
|
|
|
+ ):
|
|
|
|
|
+ self.assertEqual(cleanup._operator_summary_chat_id(), "chat-project")
|
|
|
|
|
+
|
|
|
|
|
+ with patch.dict(
|
|
|
|
|
+ os.environ,
|
|
|
|
|
+ {
|
|
|
|
|
+ "FEISHU_OPERATOR_CHAT_ID": "chat-operator",
|
|
|
|
|
+ "FEISHU_AD_PROJECT_CHAT_ID": "",
|
|
|
|
|
+ },
|
|
|
|
|
+ clear=False,
|
|
|
|
|
+ ):
|
|
|
|
|
+ self.assertEqual(cleanup._operator_summary_chat_id(), "")
|
|
|
|
|
+
|
|
|
def test_apply_deletes_denied_creative_and_marks_sent_notification(self):
|
|
def test_apply_deletes_denied_creative_and_marks_sent_notification(self):
|
|
|
from tools import creative_rejection_cleanup as cleanup
|
|
from tools import creative_rejection_cleanup as cleanup
|
|
|
|
|
|
|
@@ -2255,7 +2278,7 @@ class CreativeRejectionCleanupTests(unittest.TestCase):
|
|
|
publish.assert_not_called()
|
|
publish.assert_not_called()
|
|
|
self.assertEqual(summary["deliveries"], [])
|
|
self.assertEqual(summary["deliveries"], [])
|
|
|
|
|
|
|
|
- def test_apply_requires_operator_chat_before_any_external_work(self):
|
|
|
|
|
|
|
+ def test_apply_requires_ad_project_chat_before_any_external_work(self):
|
|
|
from tools import creative_rejection_cleanup as cleanup
|
|
from tools import creative_rejection_cleanup as cleanup
|
|
|
|
|
|
|
|
with patch.dict(
|
|
with patch.dict(
|
|
@@ -2271,6 +2294,7 @@ class CreativeRejectionCleanupTests(unittest.TestCase):
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
),
|
|
),
|
|
|
|
|
+ "FEISHU_OPERATOR_CHAT_ID": "",
|
|
|
"FEISHU_AD_PROJECT_CHAT_ID": "",
|
|
"FEISHU_AD_PROJECT_CHAT_ID": "",
|
|
|
},
|
|
},
|
|
|
clear=False,
|
|
clear=False,
|