'Compare an app against a `dict` of expected values.'

def compare(self, data, instance=None):

    mapping = {'regions': 'get_region_ids'}
    if (instance is None):
        instance = self.get_webapp()
    for (k, v) in data.iteritems():
        k = mapping.get(k, k)
        val = getattr(instance, k, '')
        if callable(val):
            val = val()
        if (val is None):
            val = ''
        eq_(unicode(val), unicode(v))
