示例#1
0
    def test_cursor_test(self):
        self.db = orm.memory_db('my_test')
        
        self.db.create_table('foo', 'id serial primary key, name varchar(128)')
        self.db.reload()

        c = self.db.cursor()
        
        x = self.db.foo.create()
        x.name = 'graham'

        assert [] == self.db.foo.find()

        x.save(cursor=c)

        assert len(self.db.foo.find()) == 1
示例#2
0
 def setUp(self):
     self.db = orm.memory_db('foo')
     assert self.db.has_no_tables() == True