'Tests the perms_info function (which passes permissions to the response context).'

def test_perms_info(self):

    layer = Layer.objects.all()[0]
    layer.set_default_permissions()
    perms_info = layer.get_all_level_info()
    self.assertEqual(len(perms_info['groups'].keys()), 1)
    layer.set_permissions({'groups': {'bar': ['view_resourcebase']}})
    perms_info = _perms_info_json(layer)
    self.assertDictEqual(json.loads(perms_info)['groups'], {'bar': ['view_resourcebase']})
