def test_show_billings_denied(self): request = self.factory.get('/billing/') request.user = self.user response = views.billing(request) self.assertEqual(response.status_code, 302)
def test_show_billings(self): request = self.factory.get('/billing/') self.user.is_superuser = True request.user = self.user response = views.billing(request) self.assertEqual(response.status_code, 200)
def test_create_billing(self): idCustomer = Customer.objects.filter(name='Intern')[0].id idProject = Project.objects.get(name = 'test').id request = self.factory.post('/billing/', {'project': idProject, 'export': 0, 'billing': 0}) self.user.is_superuser = True request.user = self.user response = views.billing(request) self.assertEqual(response.status_code, 200)
def test_create_billing(self): idCustomer = Customer.objects.filter(name='Intern')[0].id idProject = Project.objects.get(name='test').id request = self.factory.post('/billing/', { 'project': idProject, 'export': 0, 'billing': 0 }) self.user.is_superuser = True request.user = self.user response = views.billing(request) self.assertEqual(response.status_code, 200)