1π
β
One way to approach this would be to make your own fake version of send_email_template()
that does nothing except verify that it was called with the desired argument values, and raises an exception if they are wrong.
Then, in your test setup, you would replace the real send_email_template()
with your fake one. This is called Mocking.
And just to be safe you would also want to assert that your fake function was actually called.
π€John Gordon
Source:stackexchange.com