bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)


In the format string for assert_called the evaluation order is incorrect and hence for mock's without name, 'None' is printed whereas it should be 'mock' like for other messages. The error message is ("Expected '%s' to have been called." % self._mock_name or 'mock').
(cherry picked from commit 5f5f11faf9de0d8dcbe1a8a4eb35d2a4232d6eaa)

Co-authored-by: Abraham Toriz Cruz <awonderfulcode@gmail.com>
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 497aa6f..9fd5c3c 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -873,7 +873,7 @@
         """
         if self.call_count == 0:
             msg = ("Expected '%s' to have been called." %
-                   self._mock_name or 'mock')
+                   (self._mock_name or 'mock'))
             raise AssertionError(msg)
 
     def assert_called_once(self):