Fix: Test, Products Info
This commit is contained in:
parent
04d76ee7d9
commit
2e291fd0a6
@ -79,9 +79,14 @@ def search_products(request, pool, product_name):
|
||||
products = Product.search_read(
|
||||
[('name', 'like', product_name)],
|
||||
order=[('id', 'ASC')],
|
||||
fields_names=['id', 'name', 'list_price'])
|
||||
fields_names=[
|
||||
'id', 'name', 'list_price',
|
||||
'description', 'template.forecast_quantity'
|
||||
])
|
||||
|
||||
return products
|
||||
|
||||
|
||||
@app.route('/<database_name>/sale_don_confiao/sales', methods=['GET'])
|
||||
@allow_null_origin
|
||||
@with_pool
|
||||
|
@ -101,7 +101,6 @@ class DonConfiaoApiRouteTestCase(
|
||||
template, = ProductTemplate.create([{
|
||||
'name': 'Product',
|
||||
'default_uom': Uom.search([('name', '=', 'Unit')])[0].id,
|
||||
'list_price': 5000
|
||||
}])
|
||||
|
||||
Product.create([{'template': template.id}])
|
||||
@ -129,8 +128,8 @@ class DonConfiaoApiRouteTestCase(
|
||||
products = json.loads(
|
||||
response.get_data().decode())
|
||||
|
||||
raise Exception(products)
|
||||
self.assertEqual(response.status_code, HTTPStatus.OK)
|
||||
self.assertEqual(len(products), 2)
|
||||
|
||||
def test_get_sales(self):
|
||||
pool = Pool(DB_NAME)
|
||||
|
Loading…
Reference in New Issue
Block a user