From 14f59430bb779467dc2b0194a948958700b713bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Mon, 13 Apr 2020 11:54:41 +0200 Subject: [PATCH] Restore Order.add_record, used by uncloud_pay tests --- uncloud_django_based/uncloud/uncloud_pay/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/uncloud_django_based/uncloud/uncloud_pay/models.py b/uncloud_django_based/uncloud/uncloud_pay/models.py index 6e075a9..59a149c 100644 --- a/uncloud_django_based/uncloud/uncloud_pay/models.py +++ b/uncloud_django_based/uncloud/uncloud_pay/models.py @@ -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