Merge branch 'main' into avm99963-monorail

Merged commit 3779da353b36d43cf778e7d4f468097714dd4540

GitOrigin-RevId: 6451a5c6b75afb0fd1f37b3f14521148d0722ea8
diff --git a/sitewide/test/groupadmin_test.py b/sitewide/test/groupadmin_test.py
index d1f7e0f..72dfa9d 100644
--- a/sitewide/test/groupadmin_test.py
+++ b/sitewide/test/groupadmin_test.py
@@ -34,8 +34,7 @@
     self.services.usergroup.TestAddGroupSettings(888, 'group@example.com')
     self.services.usergroup.TestAddGroupSettings(
         999, 'importgroup@example.com', external_group_type='mdb')
-    self.servlet = groupadmin.GroupAdmin(
-        'req', 'res', services=self.services)
+    self.servlet = groupadmin.GroupAdmin(services=self.services)
     self.mr = testing_helpers.MakeMonorailRequest()
     self.mr.viewed_username = 'group@example.com'
     self.mr.viewed_user_auth.user_id = 888
diff --git a/sitewide/test/groupcreate_test.py b/sitewide/test/groupcreate_test.py
index bf7be8d..f82fb74 100644
--- a/sitewide/test/groupcreate_test.py
+++ b/sitewide/test/groupcreate_test.py
@@ -28,8 +28,7 @@
         user=fake.UserService(),
         usergroup=fake.UserGroupService(),
         project=fake.ProjectService())
-    self.servlet = groupcreate.GroupCreate(
-        'req', 'res', services=self.services)
+    self.servlet = groupcreate.GroupCreate(services=self.services)
     self.mr = testing_helpers.MakeMonorailRequest()
 
   def CheckAssertBasePermissions(
diff --git a/sitewide/test/groupdetail_test.py b/sitewide/test/groupdetail_test.py
index 4440bb8..f294606 100644
--- a/sitewide/test/groupdetail_test.py
+++ b/sitewide/test/groupdetail_test.py
@@ -31,8 +31,7 @@
     self.services.user.TestAddUser('c@example.com', 333)
     self.services.user.TestAddUser('group@example.com', 888)
     self.services.usergroup.TestAddGroupSettings(888, 'group@example.com')
-    self.servlet = groupdetail.GroupDetail(
-        'req', 'res', services=self.services)
+    self.servlet = groupdetail.GroupDetail(services=self.services)
     self.mr = testing_helpers.MakeMonorailRequest()
     self.mr.viewed_username = 'group@example.com'
     self.mr.viewed_user_auth.user_id = 888
@@ -142,5 +141,3 @@
     self.assertRaises(
         exceptions.NoSuchGroupException,
         self.servlet.GatherPageData, self.mr)
-
-
diff --git a/sitewide/test/moved_test.py b/sitewide/test/moved_test.py
index 04b9165..eccb195 100644
--- a/sitewide/test/moved_test.py
+++ b/sitewide/test/moved_test.py
@@ -24,7 +24,7 @@
   def setUp(self):
     self.services = service_manager.Services(
         project=fake.ProjectService())
-    self.servlet = moved.ProjectMoved('req', 'res', services=self.services)
+    self.servlet = moved.ProjectMoved(services=self.services)
     self.old_project = 'old-project'
 
   def testGatherPageData_NoProjectSpecified(self):
@@ -40,7 +40,7 @@
     _, mr = testing_helpers.GetRequestObjects(
         path='/hosting/moved?project=nonexistent')
 
-    with self.assertRaises(webapp2.HTTPException) as cm:
+    with self.assertRaises(Exception) as cm:
       self.servlet.GatherPageData(mr)
     self.assertEqual(404, cm.exception.code)
 
@@ -50,7 +50,7 @@
     _, mr = testing_helpers.GetRequestObjects(
         path='/hosting/moved?project=%s' % self.old_project)
 
-    with self.assertRaises(webapp2.HTTPException) as cm:
+    with self.assertRaises(Exception) as cm:
       self.servlet.GatherPageData(mr)
     self.assertEqual(400, cm.exception.code)
 
diff --git a/sitewide/test/projectcreate_test.py b/sitewide/test/projectcreate_test.py
index 8f468dd..13dc97b 100644
--- a/sitewide/test/projectcreate_test.py
+++ b/sitewide/test/projectcreate_test.py
@@ -24,7 +24,7 @@
 
   def setUp(self):
     services = service_manager.Services()
-    self.servlet = projectcreate.ProjectCreate('req', 'res', services=services)
+    self.servlet = projectcreate.ProjectCreate(services=services)
 
   def CheckAssertBasePermissions(
       self, restriction, expect_admin_ok, expect_nonadmin_ok):
diff --git a/sitewide/test/usersettings_test.py b/sitewide/test/usersettings_test.py
index 54c14ae..dd7d252 100644
--- a/sitewide/test/usersettings_test.py
+++ b/sitewide/test/usersettings_test.py
@@ -10,7 +10,10 @@
 
 import unittest
 
-import mox
+try:
+  from mox3 import mox
+except ImportError:
+  import mox
 
 from framework import framework_helpers
 from framework import permissions
@@ -27,8 +30,7 @@
   def setUp(self):
     self.mox = mox.Mox()
     self.services = service_manager.Services(user=fake.UserService())
-    self.servlet = usersettings.UserSettings(
-        'req', 'res', services=self.services)
+    self.servlet = usersettings.UserSettings(services=self.services)
 
   def tearDown(self):
     self.mox.UnsetStubs()
diff --git a/sitewide/test/userupdates_test.py b/sitewide/test/userupdates_test.py
index efae9bc..725b123 100644
--- a/sitewide/test/userupdates_test.py
+++ b/sitewide/test/userupdates_test.py
@@ -10,7 +10,10 @@
 
 import unittest
 
-import mox
+try:
+  from mox3 import mox
+except ImportError:
+  import mox
 
 from features import activities
 from services import service_manager
@@ -112,4 +115,3 @@
     self.assertEqual('st5', page_data['user_tab_mode'])
     self.assertEqual('yes', page_data['viewing_user_page'])
     self.assertEqual(uui._TAB_MODE, page_data['user_updates_tab_mode'])
-