forked from uncloud/uncloud
Restore Order.add_record, used by uncloud_pay tests
This commit is contained in:
parent
05f8f1f6c0
commit
14f59430bb
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue