Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 198 additions & 6 deletions tests/api_resources/journeys/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,41 @@ def test_method_create_with_all_params(self, client: Courier) -> None:
notification={
"brand": {"id": "id"},
"content": {
"elements": [{"type": "channel"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"channel": "email",
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "Welcome!",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
}
],
"font_size": "font_size",
"line_height": "line_height",
"padding": "padding",
"raw": {"foo": "bar"},
"type": "channel",
}
],
"version": "2022-01-01",
"scope": "default",
},
Expand Down Expand Up @@ -422,7 +456,49 @@ def test_method_put_content_with_all_params(self, client: Courier) -> None:
notification_id="x",
template_id="x",
content={
"elements": [{"type": "channel"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"channel": "email",
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"title": "Welcome!",
"type": "meta",
},
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "Hello {{data.name}}.",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
},
],
"font_size": "font_size",
"line_height": "line_height",
"padding": "padding",
"raw": {"foo": "bar"},
"type": "channel",
}
],
"version": "2022-01-01",
},
state="DRAFT",
Expand Down Expand Up @@ -586,7 +662,27 @@ def test_method_replace_with_all_params(self, client: Courier) -> None:
notification={
"brand": {"id": "id"},
"content": {
"elements": [{"type": "text"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "content",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
}
],
"version": "2022-01-01",
"scope": "default",
},
Expand Down Expand Up @@ -777,7 +873,41 @@ async def test_method_create_with_all_params(self, async_client: AsyncCourier) -
notification={
"brand": {"id": "id"},
"content": {
"elements": [{"type": "channel"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"channel": "email",
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "Welcome!",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
}
],
"font_size": "font_size",
"line_height": "line_height",
"padding": "padding",
"raw": {"foo": "bar"},
"type": "channel",
}
],
"version": "2022-01-01",
"scope": "default",
},
Expand Down Expand Up @@ -1148,7 +1278,49 @@ async def test_method_put_content_with_all_params(self, async_client: AsyncCouri
notification_id="x",
template_id="x",
content={
"elements": [{"type": "channel"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"channel": "email",
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"title": "Welcome!",
"type": "meta",
},
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "Hello {{data.name}}.",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
},
],
"font_size": "font_size",
"line_height": "line_height",
"padding": "padding",
"raw": {"foo": "bar"},
"type": "channel",
}
],
"version": "2022-01-01",
},
state="DRAFT",
Expand Down Expand Up @@ -1312,7 +1484,27 @@ async def test_method_replace_with_all_params(self, async_client: AsyncCourier)
notification={
"brand": {"id": "id"},
"content": {
"elements": [{"type": "text"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "content",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
}
],
"version": "2022-01-01",
"scope": "default",
},
Expand Down
72 changes: 70 additions & 2 deletions tests/api_resources/tenants/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,41 @@ def test_method_replace_with_all_params(self, client: Courier) -> None:
tenant_id="tenant_id",
template={
"content": {
"elements": [{"type": "channel"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"channel": "email",
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "Hello {{name}}",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
}
],
"font_size": "font_size",
"line_height": "line_height",
"padding": "padding",
"raw": {"foo": "bar"},
"type": "channel",
}
],
"version": "2022-01-01",
},
"channels": {
Expand Down Expand Up @@ -629,7 +663,41 @@ async def test_method_replace_with_all_params(self, async_client: AsyncCourier)
tenant_id="tenant_id",
template={
"content": {
"elements": [{"type": "channel"}],
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"channel": "email",
"elements": [
{
"channels": ["string"],
"if": "if",
"loop": "loop",
"ref": "ref",
"align": "left",
"bold": "bold",
"color": "color",
"content": "Hello {{name}}",
"font_size": "font_size",
"format": "markdown",
"italic": "italic",
"line_height": "line_height",
"locales": {"foo": {"content": "content"}},
"strikethrough": "strikethrough",
"text_style": "text",
"underline": "underline",
"type": "text",
}
],
"font_size": "font_size",
"line_height": "line_height",
"padding": "padding",
"raw": {"foo": "bar"},
"type": "channel",
}
],
"version": "2022-01-01",
},
"channels": {
Expand Down
Loading
Loading