Restore Order.add_record, used by uncloud_pay tests

This commit is contained in:
fnux 2020-04-13 11:54:41 +02:00
parent 05f8f1f6c0
commit 14f59430bb

View file

@ -476,6 +476,15 @@ class Order(models.Model):
def recurring_price(self):
return reduce(lambda acc, record: acc + record.recurring_price, self.records, 0)
# Used by uncloud_pay tests.
def add_record(self, one_time_price, recurring_price, description):
OrderRecord.objects.create(order=self,
one_time_price=one_time_price,
recurring_price=recurring_price,
description=description)
class OrderRecord(models.Model):
"""
Order records store billing informations for products: the actual product