Merge branch 'main' into avm99963-monorail

Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266

GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/features/test/notify_helpers_test.py b/features/test/notify_helpers_test.py
index 615da38..c1ebe83 100644
--- a/features/test/notify_helpers_test.py
+++ b/features/test/notify_helpers_test.py
@@ -1,8 +1,7 @@
 # -*- coding: utf-8 -*-
-# 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.
 
 """Tests for notify_helpers.py."""
 from __future__ import print_function
@@ -11,6 +10,7 @@
 
 import json
 import mock
+import six
 import unittest
 import os
 
@@ -20,7 +20,7 @@
 from framework import emailfmt
 from framework import framework_views
 from framework import urls
-from proto import user_pb2
+from mrproto import user_pb2
 from services import service_manager
 from testing import fake
 
@@ -46,7 +46,7 @@
     self.assertEqual(queue, features_constants.QUEUE_OUTBOUND_EMAIL)
 
     task_call_args = get_client_mock().create_task.call_args_list
-    ((_parent, task), _kwargs) = task_call_args[0]
+    _, kwargs = task_call_args[0]
     expected_task = {
         'app_engine_http_request':
             {
@@ -59,8 +59,8 @@
                 }
             }
     }
-    self.assertEqual(task, expected_task)
-    ((_parent, task), _kwargs) = task_call_args[1]
+    self.assertEqual(kwargs['task'], expected_task)
+    _, kwargs = task_call_args[1]
     expected_task = {
         'app_engine_http_request':
             {
@@ -73,7 +73,7 @@
                 }
             }
     }
-    self.assertEqual(task, expected_task)
+    self.assertEqual(kwargs['task'], expected_task)
 
 
 class MergeLinkedAccountReasonsTest(unittest.TestCase):
@@ -366,9 +366,12 @@
 
     expected_html_body = (
         notify_helpers.HTML_BODY_WITH_GMAIL_ACTION_TEMPLATE % {
-            'url': self.detail_url,
-            'body': '%s-- <br/>%s' % (unicode_content.decode('utf-8'),
-                                      self.expected_html_footer)})
+            'url':
+                self.detail_url,
+            'body':
+                '%s-- <br/>%s' %
+                (six.ensure_text(unicode_content), self.expected_html_footer)
+        })
     self.assertEqual(expected_html_body, email_task['html_body'])
 
   def testHtmlBody_WithLinks(self):
@@ -442,7 +445,7 @@
 
     escaped_body_with_html_content = (
         '&lt;a href=&quot;http://www.google.com&quot;&gt;test&lt;/a&gt; '
-        '&#39;something&#39;')
+        '&#x27;something&#x27;')
     notify_helpers._MakeNotificationFooter(
         ['reason'], REPLY_NOT_ALLOWED, 'example.com')
     expected_html_body = (