'Test that a non superuser, that can see different layers on different sites,
can see the correct subset of layer on a normal site'

def test_non_superuser_normal_site_subset_layers(self):

    anonymous_group = Group.objects.get(name='anonymous')
    for layer in Layer.objects.all()[:3]:
        remove_perm('view_resourcebase', self.bobby, layer.get_self_resource())
        remove_perm('view_resourcebase', anonymous_group, layer.get_self_resource())
    self.client.login(username='bobby', password='bob')
    response = self.client.get(self.api_layer_url)
    self.assertEquals(len(json.loads(response.content)['objects']), 5)
    self.client.logout()
    self.client.login(username=self.user, password=self.passwd)
    response = self.client.get(self.api_layer_url)
    self.assertEquals(len(json.loads(response.content)['objects']), 7)
