Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2816)

Unified Diff: appengine/findit/common/test/base_handler_test.py

Issue 2537143003: [Findit] Redirect to original page after login for triage. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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'

Powered by Google App Engine
This is Rietveld 408576698