def test_convert_reasons_to_task__normal(self): actual = notifier.convert_reasons_to_task('addr', ['reason 1', 'reason 2'], 'html', 'subject') self.assertItemsEqual(['to', 'subject', 'html'], actual.keys()) self.assertEqual('addr', actual['to']) self.assertEqual('subject', actual['subject']) self.assertIn('html', actual['html']) self.assertIn('reason 1', actual['html']) self.assertIn('reason 2', actual['html'])
def test_convert_reasons_to_task__no_reasons(self): with self.assertRaises(AssertionError): notifier.convert_reasons_to_task('addr', [], 'html', 'subject')