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)
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)
def test_suspicious_widget_without_suspicion(self): widget = SuspiciousWidget() json_value = 'null' rendered = widget.render('Name', json_value) self.assertEqual('', rendered)