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