you can access the href directly with:

``code: python
portlet().css('li.child > a').first.attrib.get('href')
``
then you can use self.assertEqual instead self.assertIn wich will create a better error message if the test are failing.

``code: python
self.assertEqual('href="http://nohost/plone/the-folder/my-image/view"', portlet().css('li.child > a').first.attrib.get('href'))
``