Example #1
0
 def test_suspicious_widget_with_new_suspicion(self):
     widget = SuspiciousWidget()
     json_value = '{"whatever": true, "invalid_cnpj_cpf": true}'
     rendered = widget.render('Name', json_value)
     self.assertIn('CPF ou CNPJ inválidos', rendered)
     self.assertIn('<br>', rendered)
     self.assertIn('whatever', rendered)
Example #2
0
 def test_suspicious_widget_with_two_suspicions(self):
     widget = SuspiciousWidget()
     json_value = '{"invalid_cnpj_cpf": true, "election_expenses": true}'
     rendered = widget.render('Name', json_value)
     self.assertIn('CPF ou CNPJ inválidos', rendered)
     self.assertIn('<br>', rendered)
     self.assertIn('Gasto com campanha eleitoral', rendered)
Example #3
0
 def test_suspicious_widget_without_suspicion(self):
     widget = SuspiciousWidget()
     json_value = 'null'
     rendered = widget.render('Name', json_value)
     self.assertEqual('', rendered)