Increase security and reformat
This commit is contained in:
@@ -9,8 +9,8 @@ from core.commands.base import CommandContext
|
||||
from core.commands.handlers.bp import BPCommandHandler
|
||||
from core.commands.policies import ensure_variant_policies_for_profile
|
||||
from core.models import (
|
||||
BusinessPlanDocument,
|
||||
AI,
|
||||
BusinessPlanDocument,
|
||||
ChatSession,
|
||||
CommandAction,
|
||||
CommandChannelBinding,
|
||||
@@ -37,7 +37,9 @@ class CommandVariantPolicyTests(TransactionTestCase):
|
||||
service="whatsapp",
|
||||
identifier="120363402761690215",
|
||||
)
|
||||
self.session = ChatSession.objects.create(user=self.user, identifier=self.identifier)
|
||||
self.session = ChatSession.objects.create(
|
||||
user=self.user, identifier=self.identifier
|
||||
)
|
||||
self.profile = CommandProfile.objects.create(
|
||||
user=self.user,
|
||||
slug="bp",
|
||||
@@ -109,7 +111,9 @@ class CommandVariantPolicyTests(TransactionTestCase):
|
||||
|
||||
def test_bp_primary_can_run_in_verbatim_mode_without_ai(self):
|
||||
ensure_variant_policies_for_profile(self.profile)
|
||||
policy = CommandVariantPolicy.objects.get(profile=self.profile, variant_key="bp")
|
||||
policy = CommandVariantPolicy.objects.get(
|
||||
profile=self.profile, variant_key="bp"
|
||||
)
|
||||
policy.generation_mode = "verbatim"
|
||||
policy.send_plan_to_egress = False
|
||||
policy.send_status_to_source = False
|
||||
@@ -143,7 +147,9 @@ class CommandVariantPolicyTests(TransactionTestCase):
|
||||
|
||||
def test_bp_set_ai_mode_ignores_template(self):
|
||||
ensure_variant_policies_for_profile(self.profile)
|
||||
policy = CommandVariantPolicy.objects.get(profile=self.profile, variant_key="bp_set")
|
||||
policy = CommandVariantPolicy.objects.get(
|
||||
profile=self.profile, variant_key="bp_set"
|
||||
)
|
||||
policy.generation_mode = "ai"
|
||||
policy.send_plan_to_egress = False
|
||||
policy.send_status_to_source = False
|
||||
@@ -222,4 +228,6 @@ class CommandVariantPolicyTests(TransactionTestCase):
|
||||
self.assertTrue(result.ok)
|
||||
source_status.assert_awaited()
|
||||
self.assertEqual(1, binding_send.await_count)
|
||||
self.assertFalse(BusinessPlanDocument.objects.filter(trigger_message=trigger).exists())
|
||||
self.assertFalse(
|
||||
BusinessPlanDocument.objects.filter(trigger_message=trigger).exists()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user