def METHOD_NAME(self):
    """
    Ensure that this function converts the value passed to bytes before
    attempting to encode, avoiding a UnicodeEncodeError on Python 2 and a
    TypeError on Python 3.
    """
    self.assertEqual(
        salt.utils.hashutils.base64_encodestring(self.str),
        self.str_encodestring_result,
    )
    self.assertEqual(
        salt.utils.hashutils.base64_encodestring(self.bytes),
        self.bytes_encodestring_result,
    )