I'm just setting this up now, and it's working well with my manual testing. I am using the agent to persist tokens across sessions, and have made some simple middleware to require is_verified for all but a whitelisted list of URLs.
I'd like to extend my tests to cover the 2fa workflows, and was wondering if there was any support for it, or any tips. The native django test client is a bit magical with its login() method, and it's not trivial (to my eyes) to see how to register a device for a test user, and enable it. django_otp's login() method requires a request object, which you don't seem to have in the test_client context.
Does anyone have an idea how best to proceed? I have created a simple StaticDevice generator for a given test user and have the token, but am not sure how to associate it with the test client.
Thanks for any ideas.
Nick