This might be better expressed as:

```python
u_errors = [(msg.encode("utf-8"), err.encode("utf-8"))
            for msg, err in modulestore.get_item_errors(course.location)]
self.assertTrue(any(expect in msg or expect in err for msg, err in u_errors),
    "Message '{}' not found in modulestore.get_item_errors()".format(expect))
```