-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from Stranger6667/dd/template-alias-fix
fix: Make `TemplateID` not required if `TemplateAlias` is specified
- Loading branch information
Showing
6 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,6 +206,24 @@ def test_send_with_template(self, postmark): | |
"To": "[email protected]", | ||
} | ||
|
||
def test_template_with_alias_only(self, postmark): | ||
# It should be possible to specify `TemplateAlias` and not `TemplateId` | ||
postmark.emails.EmailTemplate( | ||
TemplateAlias="foo", | ||
TemplateModel={}, | ||
From="[email protected]", | ||
To="[email protected]", | ||
) | ||
|
||
def test_send_with_template_without_alias_and_id(self, postmark): | ||
# If there is no `TemplateAlias` and `TemplateId` then it is an error | ||
with pytest.raises(ValueError): | ||
postmark.emails.send_with_template( | ||
TemplateModel={}, | ||
From="[email protected]", | ||
To="[email protected]", | ||
) | ||
|
||
|
||
class TestBatchSend: | ||
def test_email_instance(self, postmark, email, postmark_request): | ||
|