'Test auth_freebie_transaction'

@patch('r2.lib.authorize.interaction.Bid._new')
def test_auth_freebie_transaction(self, _new):

    link = Mock(spec=Link)
    link._id = 99
    amount = 100
    campaign_id = 99
    return_value = auth_freebie_transaction(amount, self.user, link, campaign_id)
    self.assertTrue(_new.called)
    self.assertEqual(return_value, ((- link._id), ''))
    with patch('r2.lib.authorize.interaction.Bid.one') as one:
        one_mock = MagicMock()
        one.return_value = one_mock
        auth_freebie_transaction(amount, self.user, link, campaign_id)
        self.assertTrue(one_mock.auth.called)
