Reputation: 31
I'm writing unittests (using webtest) for a Cloud Endpoints API written in python. One of these methods requires authentication. I've set USER_ID, USER_EMAIL and USER_IS_ADMIN with testbed.setup_env(), but that doesn't seem to work. What's the best way to mock authentication for endpoints unittests?
Upvotes: 2
Views: 72
Reputation: 31
Turns out the correct answer is to mock out endpoints.get_current_user() and possibly oauth.is_current_user_admin()!
Upvotes: 1