I have this code in my views.py
@otp_required
def decrypt(request):
pass
This decorator makes sure that the user needs to be logged in with 2FA to view this page. However how can i simulate a logged in user with 2FA in my tests? I couldn't find anything in the docs regarding this 2FA module that explains how to run tests on a view with this decorator. Is there a specific test package i could use that will ignore this @otp_required
or get around it somehow?
Something like this?
@patch(views.decrypt)
def test(self):
response = self.client.get('/decrypt')
self.assertEqual(response.status_code, 200)