'Passed a list of dicts formed similar to the return value from
self.grouped_apps() and a collection serialization, asserts that the
apps in the serialization are in the correct groups as specified by the
list of dicts.'

def assertGroupedAppsEqual(self, grouped_apps, data):

    compare = {}
    for group in grouped_apps:
        for app in group['apps']:
            compare[app] = group['name']
    for app in data['apps']:
        eq_(compare[app['id']], app['group'])
