

def testBuildProduct(self):
    models.Category.buildAllCategories()
    self.assertRaises(errors.Error, docs.Product.buildProduct, {
        
    })
    product = docs.Product.buildProduct(PRODUCT_PARAMS)
    self.assert_((product is not None))
    self.assertEqual(product.price, PRODUCT_PARAMS['price'])
    sq = search.Query(query_string='Sir Arthur Conan Doyle')
    res = docs.Product.getIndex().search(self)
    self.assertEqual(res.number_found, 1)
    for doc in res:
        self.assertEqual(doc.doc_id, product.doc_id)

dataset/ETHPy150Open GoogleCloudPlatform/appengine-search-python-java/product_search_python/tests/test_search.py FTSTestCase.testBuildProduct/VarMisuse@98/129 `sq`->`self`