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:
Levi 2016-05-12 01:57:34 -05:00
commit bf17e80df4
11 changed files with 360 additions and 19 deletions

View file

@ -143,8 +143,9 @@ class SignupView(CreateView):
return HttpResponseRedirect(self.get_success_url())
class PaymentVMView(FormView):
class PaymentVMView(LoginRequiredMixin, FormView):
template_name = 'hosting/payment.html'
login_url = reverse_lazy('hosting:login')
form_class = BillingAddressForm
def get_context_data(self, **kwargs):
@ -183,7 +184,7 @@ class PaymentVMView(FormView):
billing_address = form.save()
# Create a Hosting Order
order = HostingOrder.create(VMPlan=plan, customer=customer,
order = HostingOrder.create(vm_plan=plan, customer=customer,
billing_address=billing_address)
# Make stripe charge to a customer