-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In tests, add a shortcut to assert mails are sent with correct parameters #16
Comments
I used such tools in django-downloadview: shortcuts to check that download views actually return expected responses. Since it is a common task to override and configure custom download views, test utilities are really helpful. See: |
This looks to me to be a mail-factory features doesn't it? https://github.com/novagile/django-mail-factory/blob/master/mail_factory/mails.py#L37 |
I was thinking of checks like:
Little code may be needed for each check, but if every user is supposed to write this little code, perhaps some shortcuts would help. And perhaps test utilities would encourage users to write tests. |
That sounds good to me. |
As a django-mail-factory user, I setup Python functions (like views) that send email using mail_factory... thus I setup tests to check that mails are actually sent with expected parameters.
Since this is a common task, I would appreciate a shortcut that makes tests easier to write.
The feature is mainly for users.
Maybe it could also be used by django-mail-factory's own tests.
Here is an example of what I'm thinking of:
... where the "validator" is an helper to check result/usage of django-mail-factory, at least most common use cases.
Perhaps the example is not a good one, I'm not experienced enough to tell what is usually tested, or what should be tested.
I guess that, if mail_factory had test utilities, I would simply use them (and test what they cover).
The text was updated successfully, but these errors were encountered: