[Fixed]-Django authenticate unit test

1👍

You’re patching the wrong thing: all you’ve done is change what authenticate refers to within your test, not in the view. You should patch your_view.auth.authenticate.

See the Mock docs on Where to patch.

Leave a comment