++dev
This commit is contained in:
parent
caedf874e4
commit
8bbcc5df5f
3 changed files with 24 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ from django.core.exceptions import ValidationError
|
|||
from .views import *
|
||||
from .models import *
|
||||
|
||||
from uncloud_pay.models import BillingAddress, Order
|
||||
|
||||
class VPNTests(TestCase):
|
||||
def setUp(self):
|
||||
|
|
@ -61,12 +62,19 @@ class VPNTests(TestCase):
|
|||
})
|
||||
force_authenticate(request, user=self.user)
|
||||
|
||||
# we don't have a billing address
|
||||
# we don't have a billing address -> raises error
|
||||
with self.assertRaises(ValidationError):
|
||||
response = view(request)
|
||||
|
||||
ba = BillingAddress.objects.create(owner=self.user)
|
||||
|
||||
# This should work now
|
||||
response = view(request)
|
||||
|
||||
# Verify that an order was created successfully - there should only be one order at
|
||||
# this point in time
|
||||
order = Order.objects.get(owner=self.user)
|
||||
|
||||
#print(response)
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue