示例#1
0
    def test_get_semi_paid_from_item_not_exist(self):
        watcher = payout_engine.PayoutWatcher([], [])
        payout_engine.ReportSemiPaid.objects.get.side_effect = ObjectDoesNotExist()

        watcher._safe_get_semi_paid_from_item({'payout_item': {'sender_item_id': 'report1_123'}})

        payout_engine.ReportSemiPaid.objects.get.assert_called_once_with(report='report1')
        payout_engine.ReportSemiPaid.assert_called_once_with(report='report1')
        payout_engine.ReportSemiPaid().save.assert_called_once_with()
示例#2
0
    def test_get_semi_paid_not_exist(self):
        watcher = payout_engine.PayoutWatcher([], [])
        payout_engine.ReportSemiPaid.objects.get.side_effect = ObjectDoesNotExist()

        watcher._safe_get_semi_paid('report1')

        payout_engine.ReportSemiPaid.objects.get.assert_called_once_with(report='report1')
        payout_engine.ReportSemiPaid.assert_called_once_with(report='report1')
        payout_engine.ReportSemiPaid().save.assert_called_once_with()