Create a default VMPricing
This commit is contained in:
parent
215047aee5
commit
bce5905842
1 changed files with 7 additions and 5 deletions
|
|
@ -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,12 +101,14 @@ class CeleryTaskTestCase(TestCase):
|
|||
cpu = specs.get('cpu')
|
||||
memory = specs.get('memory')
|
||||
disk_size = specs.get('disk_size')
|
||||
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)
|
||||
# because we don't have a VMPricing by default
|
||||
# get_vm_price should return None
|
||||
self.assertEquals(amount_to_be_charged, None)
|
||||
amount_to_be_charged = specs.get('price')
|
||||
plan_name = StripeUtils.get_stripe_plan_name(cpu=cpu,
|
||||
memory=memory,
|
||||
disk_size=disk_size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue