Open benoitbryon opened 11 years ago
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. Did you need to do that for one of your project? If yes do you mind doing a PR?
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).