Beispiel #1
0
    def test_get(self):
        ds = self._ds_get_balance(9)

        currency_id = "test.testcurrency"
        currency = Currency(currency_id)

        cb = Mock()
        currency.get_balance(ds, _m_user(), cb)

        cb.assert_called_once_with(9)
        ds.get_balance.assert_called_once_with(1010, currency, ANY)
Beispiel #2
0
    def test_award(self):
        ds = self._ds_add_balance(9)

        currency_id = "test.testcurrency"
        currency = Currency(currency_id)

        cb = Mock()
        currency.award(ds, _m_user(), 1, cb)

        cb.assert_called_once_with(9)
        ds.add_balance.assert_called_once_with(1010, currency, 1, ANY)