Exemplo n.º 1
0
    def testGetCategories(self):
        """
        """
        cm = ICategoryManagement(self.portal.myshop.categories.category_1)
        category_ids = [c.getId() for c in cm.getCategories()]

        for id in ["category_11", "category_12"]:
            self.failUnless(id in category_ids)

        cm = ICategoryManagement(self.category_2)
        self.assertEqual(cm.getCategories(), [])
Exemplo n.º 2
0
    def testGetCategories(self):
        """
        """
        cm = ICategoryManagement(self.portal.myshop.categories.category_1)
        category_ids = [c.getId() for c in cm.getCategories()]
        
        for id in ["category_11", "category_12"]:
            self.failUnless(id in category_ids)

        cm = ICategoryManagement(self.category_2)
        self.assertEqual(cm.getCategories(), [])
    def testGetCategories_1(self):
        """
        """
        cm = ICategoryManagement(self.product_1)

        ids = [c.getId() for c in cm.getCategories()]
        self.assertEqual(ids, ["category_11"])

        # adding some more
        self.shop.categories.invokeFactory("Category", id="category_a")
        self.shop.categories.invokeFactory("Category", id="category_b")

        self.shop.categories.category_a.addReference(self.product_1, "easyshopcategory_easyshopproduct")
        self.shop.categories.category_b.addReference(self.product_1, "easyshopcategory_easyshopproduct")

        ids = [c.getId() for c in cm.getCategories()]
        for id in ["category_11", "category_a", "category_b"]:
            self.failUnless(id in ids)
Exemplo n.º 4
0
    def testGetCategories(self):
        """
        """
        cm = ICategoryManagement(self.shop)
        ids = [c.getId() for c in cm.getCategories()]

        self.failUnless("category_1" in ids)
        self.failUnless("category_2" in ids)
        self.failUnless("category_11" in ids)
        self.failUnless("category_111" in ids)
 def testGetCategories(self):
     """
     """        
     cm = ICategoryManagement(self.shop)
     ids = [c.getId() for c in cm.getCategories()]
         
     self.failUnless("category_1"   in ids)
     self.failUnless("category_2"   in ids)        
     self.failUnless("category_11"  in ids)
     self.failUnless("category_111" in ids)
    def testGetCategories_1(self):
        """
        """
        cm = ICategoryManagement(self.product_1)

        ids = [c.getId() for c in cm.getCategories()]        
        self.assertEqual(ids, ["category_11"])

        # adding some more
        self.shop.categories.invokeFactory("Category", id="category_a")
        self.shop.categories.invokeFactory("Category", id="category_b")
        
        self.shop.categories.category_a.addReference(
            self.product_1, 
            "easyshopcategory_easyshopproduct")
        self.shop.categories.category_b.addReference(
            self.product_1, 
            "easyshopcategory_easyshopproduct")
                                        
        ids = [c.getId() for c in cm.getCategories()]
        for id in ["category_11", "category_a", "category_b"]:
            self.failUnless(id in ids)
 def testGetCategories_2(self):
     """No categories there
     """
     cm = ICategoryManagement(self.product_3)
     self.assertEqual(cm.getCategories(), [])
 def testGetCategories_2(self):
     """No categories there
     """
     cm = ICategoryManagement(self.product_3)
     self.assertEqual(cm.getCategories(), [])