Merge branch 'main' into avm99963-monorail

Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266

GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/framework/test/servlet_helpers_test.py b/framework/test/servlet_helpers_test.py
index 870de40..4700e12 100644
--- a/framework/test/servlet_helpers_test.py
+++ b/framework/test/servlet_helpers_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
 
 """Unit tests for servlet base class helper functions."""
 from __future__ import print_function
@@ -12,12 +11,12 @@
 import settings
 
 from google.appengine.ext import testbed
-
+from six.moves import urllib
 
 from framework import permissions
 from framework import servlet_helpers
-from proto import project_pb2
-from proto import tracker_pb2
+from mrproto import project_pb2
+from mrproto import tracker_pb2
 from testing import testing_helpers
 
 
@@ -217,30 +216,21 @@
   def tearDown(self):
     self.testbed.deactivate()
 
-  def testCreateLoginUrl(self):
-    _, mr = testing_helpers.GetRequestObjects(
-        path='/p/proj/issues/detail?id=123&q=term', project=self.project)
-    url = servlet_helpers.SafeCreateLoginURL(mr, 'current.url.to.return.to')
-    # Ensure that users can pick their account to use with Monorail.
-    self.assertIn('/AccountChooser', url)
-    self.assertIn('current.url.to.return.to', url)
-
-  def testCreateLoginUrl(self):
-    _, mr = testing_helpers.GetRequestObjects(
-        path='/p/proj/issues/detail?id=123&q=term', project=self.project)
-    url = servlet_helpers.SafeCreateLoginURL(mr, 'current.url.to.return.to')
-    # Ensure that users can pick their account to use with Monorail.
-    self.assertIn('/AccountChooser', url)
-    self.assertIn('current.url.to.return.to', url)
-
   def testCreateEscapedLoginUrlFromMR(self):
     _, mr = testing_helpers.GetRequestObjects(
         path='/p/proj/issues/detail?id=123&q=term', project=self.project)
     mr.current_page_url_encoded = (
         'https%3A%2F%2Fbugs.chromium.org'
-        '%2Fp%2Fchromium%2Fissues%2Fentry')
+        '%2Fp%2Fchromium%2Fissues%2Fentry%3F'
+        'template%3DBuild%2520Infrastructure%26'
+        'labels%3DRestrict-View-Google%2CInfra-Troopers')
     url = servlet_helpers.SafeCreateLoginURL(mr)
-    self.assertIn('https%3A%2F%2Fbugs.chromium.org%2Fp', url)
+    double_encoded_query = (
+        'https%253A%252F%252Fbugs.chromium.org'
+        '%252Fp%252Fchromium%252Fissues%252Fentry%253F'
+        'template%253DBuild%252520Infrastructure%2526'
+        'labels%253DRestrict-View-Google%252CInfra-Troopers')
+    self.assertIn(double_encoded_query, url)
 
   def testCreateLogoutUrl(self):
     _, mr = testing_helpers.GetRequestObjects(