How do I test the case of attempting to refresh an expired token? Or the case of trying to exceed JWT_REFRESH_EXPIRATION_DELTA
?
I'm looking for the most pythonic/djangotacular way to unit test a token refresh endpoint. AFAICT, my endpoint is working fine-it's refreshing the token, and when I test it via python REPL, it does what I expect. But since this is a documented bug I'm fixing, I'd like to end up with the fix under my test harness. Testing the positive case is easy, but I'm unsure of how to proceed from here. I don't want to do some delay loop or something like that, since that would undermine the whole unit test ideology of running quickly and in isolation...
my tests are currently using the response = self.client.post(...)
style.