| Index: appengine/findit/common/test/base_handler_test.py
|
| diff --git a/appengine/findit/common/test/base_handler_test.py b/appengine/findit/common/test/base_handler_test.py
|
| index 083a77157583322bf3ef846415b70cc1bb0501a3..5f64114d723cc4ff2d5356620894606e1f4f8402 100644
|
| --- a/appengine/findit/common/test/base_handler_test.py
|
| +++ b/appengine/findit/common/test/base_handler_test.py
|
| @@ -109,6 +109,18 @@ class PermissionTest(testing.AppengineTestCase):
|
| PermissionLevelHandler.PERMISSION_LEVEL = 80000 # An unknown permission.
|
| self._VerifyUnauthorizedAccess('test@google.com')
|
|
|
| + def testLoginLinkForGetButForceToUseReferer(self):
|
| + PermissionLevelHandler.PERMISSION_LEVEL = Permission.CORP_USER
|
| + PermissionLevelHandler.REDIRECT_TO_DISTINATION_PAGE_FOR_GET = False
|
| + referer_url = 'http://localhost/referer'
|
| + login_url = ('https://www.google.com/accounts/Login?continue=%s' %
|
| + urllib.quote(referer_url))
|
| + self.assertRaisesRegexp(
|
| + webtest.app.AppError,
|
| + re.compile('.*401 Unauthorized.*%s.*' % re.escape(login_url),
|
| + re.MULTILINE | re.DOTALL),
|
| + self.test_app.get, '/permission', headers={'referer': referer_url})
|
| +
|
| def testLoginLinkForGetWithReferer(self):
|
| PermissionLevelHandler.PERMISSION_LEVEL = Permission.CORP_USER
|
| referer_url = 'http://localhost/referer'
|
|
|