'Tests the resources method on a Group object.'

def test_group_resource(self):

    layer = Layer.objects.all()[0]
    map = Map.objects.all()[0]
    perm_spec = {'groups': {'bar': ['change_resourcebase']}}
    layer.set_permissions(perm_spec)
    map.set_permissions(perm_spec)
    self.assertTrue((layer.get_self_resource() in self.bar.resources()))
    self.assertTrue((map.get_self_resource() in self.bar.resources()))
    self.assertTrue((layer.get_self_resource() in self.bar.resources(resource_type='layer')))
    self.assertTrue((map.get_self_resource() not in self.bar.resources(resource_type='layer')))
    layer.set_permissions('{}')
    self.assertFalse((layer.get_self_resource() in self.bar.resources()))
