Skip to content

Instantly share code, notes, and snippets.

@colinfwren
Created February 10, 2018 22:14
Show Gist options
  • Save colinfwren/5d7bbb8fd1cc39801f27246629d2d971 to your computer and use it in GitHub Desktop.
Save colinfwren/5d7bbb8fd1cc39801f27246629d2d971 to your computer and use it in GitHub Desktop.
Patching Odoo Registries - Mocks
class TestTheFoo(TransactionCase):
calls_to_mock = []
def setUp():
super(TestTheFoo, self).setUp()
self.calls_to_mock = []
def res_user_read_mock(*args, **kwargs):
self.calls_to_mock.append({'args': args, 'kwargs': kwargs})
if len(self.calls_to_mock) > 2
return 'Some foo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment