Did I find the right examples for you? yes no

All Samples(20)  |  Call(20)  |  Derive(0)  |  Import(0)

src/m/i/Ming-0.4.7/ming/tests/odm/test_declarative.py   Ming(Download)
    def test_mapper_extension(self):
        doc = self.Basic()
        doc.a = 5
        self.session.flush()
        doc.a = 6
    def test_repr(self):
        doc = self.Basic(a=1, b=[2,3], c=dict(d=4, e=5))
        repr(self.session)
 
    def test_create(self):
        doc = self.Basic()
    def test_mapped_object(self):
        doc = self.Basic(a=1, b=[2,3], c=dict(d=4, e=5))
        self.assertEqual(doc.a, doc['a'])
        self.assertEqual(doc.d, None)
        self.assertRaises(AttributeError, getattr, doc, 'e')
    def test_mapper(self):
        m = mapper(self.Basic)
        self.assertEqual(repr(m), '<Mapper Basic:basic>')
        doc = self.Basic(a=1, b=[2,3], c=dict(d=4, e=5))
        self.session.flush()

src/m/i/Ming-0.4.7/ming/tests/odm/test_mapper.py   Ming(Download)
    def test_orphan_object(self):
        obj = self.Basic()
        assert session(obj) is self.session
        self.session.clear()
        assert session(obj) is None
    def test_set_to_same(self):
        obj = self.Basic(a=1)
        assert state(obj).status == 'new'
        self.session.flush()
        assert state(obj).status == 'clean'
    def test_disable_instrument(self):
        # Put a doc in the DB
        self.Basic(a=1, b=[2,3], c=dict(d=4, e=5))
        self.session.flush()
        # Load back with instrumentation
    def test_repr(self):
        doc = self.Basic(a=1, b=[2,3], c=dict(d=4,e=5))
        sdoc = repr(doc)
        assert 'a=1' in sdoc, sdoc
        assert 'b=I[2, 3]' in sdoc, sdoc
        assert "c=I{'e': 5, 'd': 4}" in sdoc, sdoc
 
    def test_create(self):
        doc = self.Basic()