Fix product activation tests after rebase
This commit is contained in:
		
					parent
					
						
							
								83d2cd465d
							
						
					
				
			
			
				commit
				
					
						86775af4c8
					
				
			
		
					 3 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -579,7 +579,7 @@ class Product(UncloudModel):
 | 
			
		|||
        if being_created:
 | 
			
		||||
            record = OrderRecord(
 | 
			
		||||
                one_time_price=self.one_time_price,
 | 
			
		||||
                recurring_price=self.recurring_price(self.recurring_period),
 | 
			
		||||
                recurring_price=self.recurring_price(recurring_period=self.recurring_period),
 | 
			
		||||
                description=self.description)
 | 
			
		||||
            self.order.orderrecord_set.add(record, bulk=False)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ from django.contrib.auth import get_user_model
 | 
			
		|||
from datetime import datetime, date, timedelta
 | 
			
		||||
 | 
			
		||||
from .models import *
 | 
			
		||||
from ungleich_service.models import GenericServiceProduct
 | 
			
		||||
from uncloud_service.models import GenericServiceProduct
 | 
			
		||||
 | 
			
		||||
class BillingTestCase(TestCase):
 | 
			
		||||
    def setUp(self):
 | 
			
		||||
| 
						 | 
				
			
			@ -139,7 +139,7 @@ class ProductActivationTestCase(TestCase):
 | 
			
		|||
        product.save()
 | 
			
		||||
 | 
			
		||||
        # XXX: to be automated.
 | 
			
		||||
        order.add_record(product.one_time_price, product.recurring_price, product.description)
 | 
			
		||||
        order.add_record(product.one_time_price, product.recurring_price(), product.description)
 | 
			
		||||
 | 
			
		||||
        # Validate initial state: must be awaiting payment.
 | 
			
		||||
        self.assertEqual(product.status, UncloudStatus.AWAITING_PAYMENT)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ class MatrixServiceProduct(Product):
 | 
			
		|||
    domain = models.CharField(max_length=255, default='domain.tld')
 | 
			
		||||
 | 
			
		||||
    # Default recurring price is PER_MONT, see Product class.
 | 
			
		||||
    def recurring_price(self):
 | 
			
		||||
    def recurring_price(self, recurring_period=RecurringPeriod.PER_MONTH):
 | 
			
		||||
        return self.monthly_managment_fee
 | 
			
		||||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
| 
						 | 
				
			
			@ -46,8 +46,8 @@ class GenericServiceProduct(Product):
 | 
			
		|||
            decimal_places=AMOUNT_DECIMALS,
 | 
			
		||||
            validators=[MinValueValidator(0)])
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def recurring_price(self):
 | 
			
		||||
    def recurring_price(self, recurring_period=RecurringPeriod.PER_MONTH):
 | 
			
		||||
        # FIXME: handle recurring_period somehow.
 | 
			
		||||
        return self.custom_recurring_price
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue