Revision f2080d16 snf-django-lib/snf_django/utils/testing.py

b/snf-django-lib/snf_django/utils/testing.py
140 140
def mocked_quotaholder(success=True):
141 141
    with patch("synnefo.quotas.Quotaholder.get") as astakos:
142 142
        global serial
143
        serial += 1
144
        astakos.return_value.issue_one_commission.return_value = serial
143
        serial += 10
144

  
145
        def foo(*args, **kwargs):
146
            return (len(astakos.return_value.issue_one_commission.mock_calls) +
147
                    serial)
148
        astakos.return_value.issue_one_commission.side_effect = foo
145 149
        astakos.return_value.resolve_commissions.return_value = {"failed": []}
146 150
        yield
147 151

  

Also available in: Unified diff