fixed tests in order to user permissions

This commit is contained in:
Levi 2016-07-10 22:42:06 -05:00
parent 4352094680
commit a6ea27696a
2 changed files with 3 additions and 0 deletions

View file

@ -468,4 +468,5 @@ else:
from .prod import *
ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch'
GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance'

View file

@ -327,6 +327,7 @@ class VirtualMachineViewTest(BaseTestCase):
self.stripe_customer = mommy.make(StripeCustomer, user=self.customer)
self.vm = mommy.make(VirtualMachinePlan)
self.vm.assign_permissions(self.customer)
self.order = mommy.make(HostingOrder, customer=self.stripe_customer, vm_plan=self.vm)
self.url = reverse('hosting:virtual_machines', kwargs={'pk': self.vm.id})
self.view = VirtualMachineView()
@ -393,6 +394,7 @@ class OrderHostingDetailViewTest(BaseTestCase):
self.stripe_customer = mommy.make(StripeCustomer, user=self.customer)
self.order = mommy.make(HostingOrder, customer=self.stripe_customer)
self.order.assign_permissions(self.customer)
self.url = reverse('hosting:orders', kwargs={'pk': self.order.id})
self.view = OrdersHostingDetailView()
self.expected_template = 'hosting/order_detail.html'