тест
This commit is contained in:
@@ -64,3 +64,32 @@ def test_build_channel_text_supports_per_actor_placeholders() -> None:
|
||||
|
||||
assert text.count("<b>ASTAT</b>") == 1
|
||||
assert text.count("<b>MARI</b>") == 1
|
||||
|
||||
|
||||
def test_build_channel_text_inlines_actor_fragment_without_duplication() -> None:
|
||||
config = {
|
||||
"template_text": (
|
||||
'🌟 <a href="https://t.me/liebe"><b>LIEBE</b></a> she/her {{actor:liebe}}\n'
|
||||
'🌟 <a href="https://t.me/victor"><b>VICTOR</b></a> tech bot'
|
||||
),
|
||||
"actors": [
|
||||
{
|
||||
"key": "liebe",
|
||||
"display_name": "LIEBE",
|
||||
"display_html": "<b>LIEBE</b>",
|
||||
"link": "https://t.me/liebe",
|
||||
"pronouns": "she/her",
|
||||
"meta_html": " she/her ",
|
||||
"emoji": "🌟",
|
||||
"default_status": "backstage",
|
||||
"phrases": {"backstage": "в закулисье."},
|
||||
}
|
||||
],
|
||||
}
|
||||
state = {"actors": {}}
|
||||
|
||||
text = build_channel_text(config, state)
|
||||
|
||||
assert text.count("<b>LIEBE</b>") == 1
|
||||
assert "she/her в закулисье." in text
|
||||
assert "в закулисье." in text
|
||||
|
||||
Reference in New Issue
Block a user