Example #1
0
 def test_drop(self):
     Base = model_base()
     Base.bind("sqlite://")
     class Foo(Base):
         a = Column(String)
     yield Foo.create()
     yield Foo.drop()
Example #2
0
 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
Example #3
0
    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)
Example #4
0
 def setUp(self, testcase):
     testcase.Base = self.Base = Base = model_base()
     Base.bind("sqlite://")