예제 #1
0
    def check_products(self):

        cat = Category()
        assert len(cat.products) == 0, \
               ".products should be empty list by default"
        
        self.cur.execute("DELETE FROM base_node")
        self.cur.execute("DELETE FROM shop_product")
        self.cur.execute("DELETE FROM shop_product_node")
        self.cur.execute("INSERT INTO base_node (name) values ('whatever')")
        self.cur.execute("INSERT INTO shop_product (code, name) "
                         "VALUES ('a', 'ant')")
        self.cur.execute("INSERT INTO shop_product (code, name) "
                         "VALUES ('b', 'box')")
        self.cur.execute("INSERT INTO shop_product (code, name) "
                         "VALUES ('c', 'car')")
        self.cur.execute("INSERT INTO shop_product_node (productID, nodeID) "
                         "VALUES (1, 1)")
        self.cur.execute("INSERT INTO shop_product_node (productID, nodeID) "
                         "VALUES (2, 1)")
        self.cur.execute("INSERT INTO shop_product_node (productID, nodeID) "
                         "VALUES (3, 1)")

        prods = clerk.fetch(Category, ID=1).products
        assert len(prods) == 3, \
               "wrong number of categories (%s) shown on category page" \
               % len(prods)
예제 #2
0
    def check_products(self):

        cat = Category()
        assert len(cat.products) == 0, ".products should be empty list by default"

        self.cur.execute("DELETE FROM base_node")
        self.cur.execute("DELETE FROM shop_product")
        self.cur.execute("DELETE FROM shop_product_node")
        self.cur.execute("INSERT INTO base_node (name) values ('whatever')")
        self.cur.execute("INSERT INTO shop_product (code, name) " "VALUES ('a', 'ant')")
        self.cur.execute("INSERT INTO shop_product (code, name) " "VALUES ('b', 'box')")
        self.cur.execute("INSERT INTO shop_product (code, name) " "VALUES ('c', 'car')")
        self.cur.execute("INSERT INTO shop_product_node (productID, nodeID) " "VALUES (1, 1)")
        self.cur.execute("INSERT INTO shop_product_node (productID, nodeID) " "VALUES (2, 1)")
        self.cur.execute("INSERT INTO shop_product_node (productID, nodeID) " "VALUES (3, 1)")

        prods = clerk.fetch(Category, ID=1).products
        assert len(prods) == 3, "wrong number of categories (%s) shown on category page" % len(prods)
예제 #3
0
 def check_product(self):
     #@TODO: what's up with this test?
     # maybe it just tries not to get an error?
     style = clerk.fetch(Style, ID=2)
     prod = style.product
예제 #4
0
파일: testStyle.py 프로젝트: souca/sixthdev
 def check_product(self):
     #@TODO: what's up with this test?
     # maybe it just tries not to get an error?
     style = clerk.fetch(Style, ID=2)
     prod = style.product