Fixed rotate_token(request) error

The error is due to `request.META` is a `Mock` object.
Merge pull request #117 from adi-li/fix-test-suits-failed

Fixes for #103 test suits failed