fixed tests in order to user permissions
This commit is contained in:
parent
4352094680
commit
a6ea27696a
2 changed files with 3 additions and 0 deletions
|
@ -468,4 +468,5 @@ else:
|
||||||
from .prod import *
|
from .prod import *
|
||||||
|
|
||||||
|
|
||||||
|
ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch'
|
||||||
GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance'
|
GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance'
|
||||||
|
|
|
@ -327,6 +327,7 @@ class VirtualMachineViewTest(BaseTestCase):
|
||||||
|
|
||||||
self.stripe_customer = mommy.make(StripeCustomer, user=self.customer)
|
self.stripe_customer = mommy.make(StripeCustomer, user=self.customer)
|
||||||
self.vm = mommy.make(VirtualMachinePlan)
|
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.order = mommy.make(HostingOrder, customer=self.stripe_customer, vm_plan=self.vm)
|
||||||
self.url = reverse('hosting:virtual_machines', kwargs={'pk': self.vm.id})
|
self.url = reverse('hosting:virtual_machines', kwargs={'pk': self.vm.id})
|
||||||
self.view = VirtualMachineView()
|
self.view = VirtualMachineView()
|
||||||
|
@ -393,6 +394,7 @@ class OrderHostingDetailViewTest(BaseTestCase):
|
||||||
|
|
||||||
self.stripe_customer = mommy.make(StripeCustomer, user=self.customer)
|
self.stripe_customer = mommy.make(StripeCustomer, user=self.customer)
|
||||||
self.order = mommy.make(HostingOrder, customer=self.stripe_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.url = reverse('hosting:orders', kwargs={'pk': self.order.id})
|
||||||
self.view = OrdersHostingDetailView()
|
self.view = OrdersHostingDetailView()
|
||||||
self.expected_template = 'hosting/order_detail.html'
|
self.expected_template = 'hosting/order_detail.html'
|
||||||
|
|
Loading…
Reference in a new issue