Ejemplo n.º 1
0
Archivo: tests.py Proyecto: 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)
Ejemplo n.º 2
0
Archivo: utils.py Proyecto: 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()
     ])