예제 #1
0
파일: tests.py 프로젝트: 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)
예제 #2
0
파일: utils.py 프로젝트: 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()
     ])