'Test that if a layer is only visible by admin, then does not appear
in the unauthenticated list nor in the list when logged is as bobby'

def test_layer_get_list_layer_private_to_one_user(self):

    perm_spec = {'users': {'admin': ['view_resourcebase']}, 'groups': {}}
    layer = Layer.objects.all()[0]
    layer.set_permissions(perm_spec)
    resp = self.api_client.get(self.list_url)
    self.assertEquals(len(self.deserialize(resp)['objects']), 7)
    self.api_client.client.login(username='bobby', password='bob')
    resp = self.api_client.get(self.list_url)
    self.assertEquals(len(self.deserialize(resp)['objects']), 7)
    self.api_client.client.login(username=self.user, password=self.passwd)
    resp = self.api_client.get(self.list_url)
    self.assertEquals(len(self.deserialize(resp)['objects']), 8)
