'Test layer rating is removed on layer remove'

def test_rating_layer_remove(self):

    layer = Layer.objects.get(pk=3)
    layer.default_style = Style.objects.get(pk=layer.pk)
    layer.save()
    url = reverse('layer_remove', args=(layer.alternate,))
    layer_id = layer.id
    ctype = ContentType.objects.get(model='layer')
    OverallRating.objects.create(category=2, object_id=layer_id, content_type=ctype, rating=3)
    self.client.login(username='admin', password='admin')
    self.client.post(url)
    rating = OverallRating.objects.filter(category=2, object_id=layer_id)
    self.assertEquals(rating.count(), 0)
