def test_last_flashed_message_hashed(self, last_flash): """Test the last flash message is hashed.""" message_and_status = [ 'foo', 'bar' ] last_flash.return_value = message_and_status expected = base64.b64encode(json.dumps({ 'flash': message_and_status[1], 'status': message_and_status[0] })) hashed_flash = util.hash_last_flash_message() assert hashed_flash == expected