The original line here looks funky.  Shouldn't it just be `str(cosmo) == expected` all through here?  (And once we sixify this, it's probably `six.text_type(cosmo) == expected`).