Compare commits

...

3 commits

Author SHA1 Message Date
PCoder
13cd098c60 Set VMPricing when creating HostingOrder 2019-04-22 18:05:32 +02:00
PCoder
bce5905842 Create a default VMPricing 2019-04-22 18:00:04 +02:00
PCoder
215047aee5 Fix case where None is returned by get_vm_price call 2019-04-22 17:48:30 +02:00

View file

@ -10,7 +10,7 @@ from django.test import TestCase, override_settings
from model_mommy import mommy
from unittest import skipIf
from datacenterlight.models import VMTemplate
from datacenterlight.models import VMTemplate, VMPricing
from datacenterlight.tasks import create_vm_task
from hosting.models import HostingOrder
from membership.models import StripeCustomer
@ -101,6 +101,12 @@ class CeleryTaskTestCase(TestCase):
cpu = specs.get('cpu')
memory = specs.get('memory')
disk_size = specs.get('disk_size')
vm_pricing = VMPricing.objects.create(
name="default",
cores_unit_price=5,
ram_unit_price=2,
ssd_unit_price=0.6
)
amount_to_be_charged = get_vm_price(cpu=cpu, memory=memory,
disk_size=disk_size)
plan_name = StripeUtils.get_stripe_plan_name(cpu=cpu,
@ -140,7 +146,8 @@ class CeleryTaskTestCase(TestCase):
price=specs['price'],
vm_id=0,
customer=stripe_customer,
billing_address=billing_address
billing_address=billing_address,
vm_pricing=vm_pricing
)
async_task = create_vm_task.delay(