Example #1
0
File: tests.py Project: tbson/24ho
 def test_transport_register(self):
     bols = BolUtils.seeding(3)
     for bol in bols:
         bol.wooden_box = True
         bol.cny_wooden_box_fee = 2
         bol.save()
         self.assertEqual(BolUtils.cal_wooden_box_fee(bol), 2)
Example #2
0
File: utils.py Project: tbson/24ho
 def cal_wooden_box_fee(item: models.QuerySet) -> float:
     from apps.bol.utils import BolUtils
     # sum of bols's wooden box fee
     return sum([
         BolUtils.cal_wooden_box_fee(bol) for bol in item.order_bols.all()
     ])