Added test to order detail view, Added test to customer orders view, Added test to virtual machine detail view, Added test to customer booked virtual machines view
This commit is contained in:
parent
32d9b6719d
commit
e8e58066a0
6 changed files with 157 additions and 28 deletions
|
|
@ -10,14 +10,6 @@ from utils.models import BillingAddress
|
|||
from .managers import VMPlansManager
|
||||
|
||||
|
||||
class RailsBetaUser(models.Model):
|
||||
email = models.EmailField(unique=True)
|
||||
received_date = models.DateTimeField('date received')
|
||||
|
||||
def __str__(self):
|
||||
return "%s - %s" % (self.email, self.received_date)
|
||||
|
||||
|
||||
class VirtualMachineType(models.Model):
|
||||
|
||||
HETZNER_NUG = 'hetzner_nug'
|
||||
|
|
@ -86,6 +78,9 @@ class VirtualMachinePlan(models.Model):
|
|||
|
||||
objects = VMPlansManager()
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % (self.id)
|
||||
|
||||
@cached_property
|
||||
def hosting_company_name(self):
|
||||
return self.vm_type.get_hosting_company_display()
|
||||
|
|
@ -115,6 +110,9 @@ class HostingOrder(models.Model):
|
|||
cc_brand = models.CharField(max_length=10)
|
||||
stripe_charge_id = models.CharField(max_length=100, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % (self.id)
|
||||
|
||||
@cached_property
|
||||
def status(self):
|
||||
return self.ORDER_APPROVED_STATUS if self.approved else self.ORDER_DECLINED_STATUS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue