Refactor TestDeploy unit tests
Add test for token precedence in get_token_or_user()