Added based view test, Added billing address form test, payment view test , Added test for hetzner pricing calculation, Added test for bern pricing calculation, Fixed script to load initial pricing data
This commit is contained in:
parent
36de71441a
commit
bf17e80df4
11 changed files with 360 additions and 19 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from django.test import TestCase
|
||||
from .forms import ContactUsForm
|
||||
from .forms import ContactUsForm, BillingAddressForm
|
||||
|
||||
|
||||
class ContactUsFormTest(TestCase):
|
||||
|
|
@ -23,3 +23,27 @@ class ContactUsFormTest(TestCase):
|
|||
def test_invalid_form(self):
|
||||
form = ContactUsForm(data=self.incompleted_data)
|
||||
self.assertFalse(form.is_valid())
|
||||
|
||||
|
||||
class BillingAddressFormTest(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.completed_data = {
|
||||
'street_address': 'street name',
|
||||
'city': 'MyCity',
|
||||
'postal_code': '32123123123123',
|
||||
'country': 'VE',
|
||||
'token': 'a23kfmslwxhkwis'
|
||||
}
|
||||
|
||||
self.incompleted_data = {
|
||||
'street_address': 'test',
|
||||
}
|
||||
|
||||
def test_valid_form(self):
|
||||
form = BillingAddressForm(data=self.completed_data)
|
||||
self.assertTrue(form.is_valid())
|
||||
|
||||
def test_invalid_form(self):
|
||||
form = BillingAddressForm(data=self.incompleted_data)
|
||||
self.assertFalse(form.is_valid())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue