def setUp(self):
        class FakeAdapter(object):
            def __init__(self):
                self.called = False
                self.args = None
                self.return_value = [{"id": 1}]

            def __call__(self, **kwargs):
                self.called = True
                self.args = kwargs
                return self.return_value

        self.adapter = FakeAdapter()
        self.bridge = ModelBridge(self.adapter, {})
        self.relation = Test.scoped()
        self.stack_opts = {"relation": self.relation, "mode": "read"}
Beispiel #2
0
    def setUp(self):
        class FakeAdapter(object):
            def __init__(self):
                self.called = False
                self.args = None
                self.return_value = [{ 'id': 1 }]

            def __call__(self, **kwargs):
                self.called = True
                self.args = kwargs
                return self.return_value

        self.adapter = FakeAdapter()
        self.bridge = ModelBridge(self.adapter, {})
        self.relation = Test.scoped()
        self.stack_opts = { 'relation': self.relation, 'mode': 'read' }