How to assert that a list contains an element