akngs/ecogwiki — pull request #9 by jangxyz (2013-12-07 17:28:46+00:00)
Title: Add OAuth authorization

This adds OAuth support -- Not Google API, but just authorizing the google account. Wonderful things could now happen :)

There are mainly two changes:

1. `WikiPageHandler._get_cur_user` now also calls `oauth.get_current_user()`
2. checking `.is_current_user_admin()` is also done for both `users` and `oauth`.

Details are inside code and the tests.

Since appengine internally *sets* some default user in dev mode, you can't really test oauth their state. I wrote some behavioral tests instead.

I also took care of failing tests with the new code. Most of them were just insufficently stubbed.