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