Esempio n. 1
0
 def test_unknown_action_raises_404(self):
     self.assertRaises(
         Http404, lambda: services.service(
             self.request_factory.get('/service?action=whooptidoo')))
Esempio n. 2
0
 def test_no_action_raises_404(self):
     self.assertRaises(
         Http404,
         lambda: services.service(self.request_factory.get('/service')))
Esempio n. 3
0
 def test_scenarios_export_list_contains_risks(self):
     url = '/service/?action=get_scenarios_export_list&project_id=%s'
     request = self.superuser_request(url % self.project.pk)
     response = service(request)
     self.assertTrue(all(k in response.content
                         for k in self.risk_fields.keys()))
Esempio n. 4
0
 def test_unknown_action_raises_404(self):
     self.assertRaises(Http404, lambda: services.service(self.request_factory.get("/service?action=whooptidoo")))
Esempio n. 5
0
 def test_no_action_raises_404(self):
     self.assertRaises(Http404, lambda: services.service(self.request_factory.get("/service")))
Esempio n. 6
0
 def test_scenarios_export_list_contains_risks(self):
     url = '/service/?action=get_scenarios_export_list&project_id=%s'
     request = self.superuser_request(url % self.project.pk)
     response = service(request)
     self.assertTrue(
         all(k in response.content for k in self.risk_fields.keys()))