コード例 #1
0
ファイル: test_model.py プロジェクト: Jc2k/txsqlalchemy
 def test_drop(self):
     Base = model_base()
     Base.bind("sqlite://")
     class Foo(Base):
         a = Column(String)
     yield Foo.create()
     yield Foo.drop()
コード例 #2
0
ファイル: test_model.py プロジェクト: Jc2k/txsqlalchemy
 def setUp(self):
     Base = model_base()
     Base.bind("sqlite://")
     class Foo(Base):
         id = Column(Integer, primary_key=True)
         a = Column(String)
     yield Foo.create()
     self.Model = Foo
コード例 #3
0
ファイル: test_model.py プロジェクト: Jc2k/txsqlalchemy
    def test_insert_row(self):
        Base = model_base()
        Base.bind("sqlite://")
        class Foo(Base):
            idx = Column(Integer, primary_key=True)
            abx = Column(String)
        yield Foo.create()

        results = yield Foo.objects.all()
        self.assertEqual(len(results), 0)

        yield Foo.insert(abx="1")
        results = yield Foo.objects.all()
        self.assertEqual(len(results), 1)
        
        yield Foo.insert(abx="33")
        results = yield Foo.objects.all()
        self.assertEqual(len(results), 2)
コード例 #4
0
ファイル: base.py プロジェクト: Jc2k/txsqlalchemy
 def setUp(self, testcase):
     testcase.Base = self.Base = Base = model_base()
     Base.bind("sqlite://")