This commit is contained in:
Nico Schottelius 2020-05-23 21:32:56 +02:00
commit 8bbcc5df5f
3 changed files with 24 additions and 3 deletions

View file

@ -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):