Example #1
0
    def assert_env_generated_ok(self, e):
        CategoryData = e['CategoryData']
        ProductData = e['ProductData']
        OfferData = e['OfferData']

        # another sanity check, wipe out the source data
        Offer.clearTable(connection=realconn)
        Product.clearTable(connection=realconn)
        Category.clearTable(connection=realconn)
Example #2
0
    def assert_data_loaded(self, fxt):
        rs =  Category.select()
        eq_(rs.count(), 2)
        parkas = rs[0]
        rebates = rs[1]
        eq_(parkas.name, "parkas")
        eq_(rebates.name, "rebates")

        rs = Product.select()
        eq_(rs.count(), 1)
        eq_(rs[0].name, "jersey")

        rs = Offer.select()
        eq_(rs.count(), 1)
        eq_(rs[0].name, "super cash back!")

        # note that here we test that colliding fixture key links 
        # got resolved correctly :
        eq_(Category.get(fxt.product_1.category_id),   parkas)
        eq_(Category.get(fxt.offer_1.category_id),     rebates)