示例#1
0
 def test_show_report_get(self):
     request = self.factory.get('/show_report/%s/' % self.scan.id)
     request.user = self.user
     request.yauser = self.user
     request.follow = True
     response = show_report(request, self.scan.id)
     self.assertEqual(response.status_code, 200)
示例#2
0
 def test_show_report_get(self):
     request = self.factory.get('/show_report/%s/' % self.scan.id)
     request.user = self.user
     request.yauser = self.user
     request.follow = True
     response = show_report(request, self.scan.id)
     self.assertEqual(response.status_code, 200)
示例#3
0
 def test_show_report_post(self, mock_import, mock_err_msg, mock_succ_msg):
     request = self.factory.post('/show_report/%s/' % self.scan.id, {
         'vuln_id': self.vuln.id,
     })
     request.user = self.user
     request.yauser = self.user
     mock_import.return_value = ''
     response = show_report(request, self.scan.id)
     self.assertEqual(response.status_code, 403)  # CSRF!
     self.assertFalse(mock_err_msg.called)
     self.assertFalse(mock_succ_msg.called)
示例#4
0
 def test_show_report_post(self, mock_import, mock_err_msg, mock_succ_msg):
     request = self.factory.post(
             '/show_report/%s/' % self.scan.id,
              {'vuln_id': self.vuln.id,}
              )
     request.user = self.user
     request.yauser = self.user
     mock_import.return_value = ''
     response = show_report(request, self.scan.id)
     self.assertEqual(response.status_code, 403) # CSRF!
     self.assertFalse(mock_err_msg.called)
     self.assertFalse(mock_succ_msg.called)