1. zikzakmedia
  2. trytond-product_price_list_formula

Commits

Sergi Almacellas Abellana  committed 03dd3dd

Fix tests

  • Participants
  • Parent commits 26c4656
  • Branches default

Comments (0)

Files changed (2)

File price_list.py

View file
  • Ignore whitespace
 #This file is part product_price_list_formula module for Tryton.
-#The COPYRIGHT file at the top level of this repository contains 
+#The COPYRIGHT file at the top level of this repository contains
 #the full copyright notices and license terms.
 from trytond.transaction import Transaction
 from trytond.pool import Pool, PoolMeta
         except:
             self.raise_user_error('not_found_price_list', price_list)
 
-        quantity=0
+        quantity = 0
         product = Transaction().context['product']
         return self.compute(
                         price_list,
                         Transaction().context['customer'],
-                        product, 
+                        product,
                         Transaction().context['unit_price'],
                         quantity,
                         Transaction().context.get('uom', product.default_uom))
         if not products:
             self.raise_user_error('add_product')
         product = products[0]
-        context['product'] =  pool.get('product.product')(product)
+        context['product'] = pool.get('product.product')(product)
         customer = pool.get('party.party').search([], limit=1)[0]
         context['customer'] = pool.get('party.party')(customer)
         context['price_list'] = pool.get('product.price_list')

File tests/test_product_price_list_formula.py

View file
  • Ignore whitespace
 #!/usr/bin/env python
 #This file is part product_price_list_formula module for Tryton.
-#The COPYRIGHT file at the top level of this repository contains 
+#The COPYRIGHT file at the top level of this repository contains
 #the full copyright notices and license terms.
 
 import sys
         self.category = POOL.get('product.category')
         self.template = POOL.get('product.template')
         self.product = POOL.get('product.product')
-    
+
     def test0006depends(self):
         '''
         Test depends.
                     }])
 
             with transaction.set_user(0):
-                price_list1 = self.price_list.create([{
+                price_list1, = self.price_list.create([{
                     'name': 'General Price List',
                     'company': company.id,
                     'lines': [
-                        ('create', [{
-                            'formula': 'product.cost_price*1.10',
-                        }],
-                    ),],
-                    }])[0]
+                                ('create', [{
+                                    'formula': 'product.cost_price * 1.10',
+                                }],
+                            )],
+                    }])
 
                 self.assert_(price_list1)