Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)

src/d/j/django-lfc-1.0.5/lfc/tests/portlets_tests.py   django-lfc(Download)
    def test_delete_portlet(self):
        """
        """
        pas = PortletAssignment.objects.all()
        self.assertEqual(len(pas), 0)
        self.client.post(reverse("lfc_add_portlet", kwargs={"object_type_id" : ctype.id, "object_id" : self.page.id}), {"portlet_type" : "navigationportlet", "portlet-start_level" : 1, "portlet-expand_level" : 1, "slot" : 1, "position" : 1})
 
        pas = PortletAssignment.objects.all()
        self.assertEqual(len(pas), 1)
 
        self.client.post(reverse("lfc_delete_portlet", kwargs={"portletassignment_id" : pas[0].id}))
 
        pas = PortletAssignment.objects.all()
        self.assertEqual(len(pas), 0)
 
    def test_delete_portlet_2(self):
        """Two portlets of a kind.
        """
        pas = PortletAssignment.objects.all()
        self.assertEqual(len(pas), 0)
        self.client.post(reverse("lfc_add_portlet", kwargs={"object_type_id" : ctype.id, "object_id" : self.page.id}), {"portlet_type" : "navigationportlet", "portlet-start_level" : 1, "portlet-expand_level" : 1, "slot" : 1, "position" : 2})
 
        pas = PortletAssignment.objects.all()
        self.assertEqual(len(pas), 2)