changes to csv data headers

This commit is contained in:
Sam
2021-03-02 11:10:58 +00:00
parent 9baa13f30a
commit 03f06c270c
5 changed files with 17 additions and 13 deletions

View File

@@ -829,6 +829,7 @@ class ProductSearchTest(TestCase):
# first instance should be most recent
self.assertTrue(dates[i] < dates[i+1])
class MyProductsViewTest(APITestCase):
"""my_products tests
"""

View File

@@ -206,17 +206,18 @@ def product_loader(csv_reader, user, company=None):
# assemble instance data
product_data = {
'company': company,
'name': row['nombre-producto'].strip(),
'description': row['descripcion'].strip(),
'sku': row['sku'],
'name': row['nombre-producto'],
'description': row['descripcion'],
'url': row['url'].strip(),
'price': float(row['precio'].strip().replace(',','.')),
'shipping_cost': float(row['gastos-envio'].strip().replace(',','.')),
'shipping_terms': row['cond-envio'].strip(),
'discount': row['descuento'].strip(),
'stock': row['stock'].strip(),
'tags': row['tags'].strip(),
'category': row['categoria'].strip(),
'identifiers': row['identificadores'].strip(),
'price': float(row['precio'].replace(',','.')),
'shipping_cost': float(row['gastos-envio'].replace(',','.')),
'shipping_terms': row['cond-envio'],
'discount': row['descuento'],
'stock': row['stock'],
'tags': row['tags'],
'category': row['categoria'],
'identifiers': row['identificadores'],
'history': history,
'creator': user,
}