def test_misconfigured_add_notification_is_noop(): n_notifs = Notification.objects.count() AddNotification( make_bind_data( constants={ "recipient_type": RecipientType.SPECIFIC_USER, "message": "This'll never get delivered!", })).execute(Context()) assert Notification.objects.count() == n_notifs
def test_render_template(): step = Step( conditions=(), actions=[Action.unserialize(action) for action in TEST_STEP_ACTIONS], ) assert step execution_context = Context(variables={ "customer_phone": "0594036495", "language": "fi", "customer_email": "*****@*****.**" }) step.execute(context=execution_context)
def test_templated_binding_syntax_errors_swallowed(): tb = TemplatedBinding("z", constant_use=ConstantUse.CONSTANT_ONLY) assert tb.get_value(Context(), {"constant": "{{"}) == "{{"
def test_conditionless_step_executes(): step = Step(actions=[SetDebugFlag({})]) context = Context() step.execute(context) assert context.get("debug")