def test_multiple_statuses(self): with self.assertRaises(LdgReconcilerMultipleStatuses) as e: LedgerThing( [ '2016/10/23 blah', ' i: zerg $-40', ' * a: checking up $20 ; has comment', ' ! a: checking up $20', ], 'checking' ) self.assertEqual( REC_STATUS_ERROR_MESSAGE.format( date='2016/10/23', payee='blah' ), str(e.exception) ) self.assertEqual('', self.redirect.getvalue().rstrip()) self.reset_redirect() with self.assertRaises(LdgReconcilerMultipleStatuses) as e: LedgerThing( [ '2016/10/23 blah', ' i: zerg $-40', ' a: checking up $20 ; has comment', ' ! a: checking up $20', ], 'checking' ) self.assertEqual( REC_STATUS_ERROR_MESSAGE.format( date='2016/10/23', payee='blah' ), str(e.exception) )