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
Feature/async email support #33
Feature/async email support #33
Conversation
It's all perfect!
As it's actually a pseudo async support, we don't need to write an async test case. However, the testing will be not so trivial, we need to:
Feel free to do what you judge the best, these steps were just what came into my mind about creating these tests. It will simply test if the function was called. I guess we need only this, the async implementation can be handled outside of the package. |
I've changed the base branch to merge this, I can create the tests :) I'm merging now |
|
@bzhr this was released on |
@PedroBern Thanks for notifying me. I thought that you're cancelling the PR, but you were just cancelling the tests for now? |
Yes, I made some changes (used a tuple as the second argument in all function calls and some adjustments on SendPasswordResetEmailMixin). Made the tests in the testproject, live testing. The reason is that this pattern of many setting files is annoying me, I would like to use a |
Awesome! I agree that creating multiple settings files isn't very efficient way to handle the settings/testing. This is ok for simple use cases, we can discuss how to further improve it. |
Exactly. Thanks for your openness, any ideas feel free to tell me! I will have a look at this in the future when I have more time. |
This PR follows the guides from #11
Adds
ASYNC_EMAIL_TASK
setting to settings.In
mixins.py
first, ifASYNC_EMAIL_TASK
setting is defined and it's a string, will be imported in top.Then before sending each email, first it's checked if the async function is defined and if it is, call the function with the email send function and it's arguments, else just send the email.
This is done for:
Right now when I run tests, there's no test case for async functions, so either a test case needs to be provided, or we need to add async email support in the example app.
@PedroBern please review and let me know what you think.