Use hasLegend attribute in nosetests

Use hasLegend attribute instead of background attribute to filter out layers that we don't include in the tests.

Thanks @loicgasser for the tip!