'Test that after restrict view permissions on two layers
bobby is unable to see them'

def test_set_bulk_permissions(self):

    layers = Layer.objects.all()[:2].values_list('id', flat=True)
    layers_id = map((lambda x: str(x)), layers)
    self.client.login(username='admin', password='admin')
    resp = self.client.get(self.list_url)
    self.assertEquals(len(self.deserialize(resp)['objects']), 8)
    data = {'permissions': json.dumps(self.perm_spec), 'resources': layers_id}
    resp = self.client.post(self.bulk_perms_url, data)
    self.assertHttpOK(resp)
    self.client.logout()
    self.client.login(username='bobby', password='bob')
    resp = self.client.get(self.list_url)
    self.assertEquals(len(self.deserialize(resp)['objects']), 6)
