Пример #1
0
    def test_Table_adding_cols_with_object_syntax(self):
        t = Table('t')
        t.text = Text()
        t.number = Integer()
        t.save()

        self.assertTrue(db.table_exists('t'))
        self.assertEqual(db.table_fields_types('t'), {
            'text': 'text',
            'number': 'integer'
        })
Пример #2
0
    def test_Table_adding_foreing_constaints(self):
        with Table('s') as s:
            s.t = Integer()

        t = Table('t')
        t.text = Text()
        t.text.references = 's (t)'
        t.save()

        db.create('t', text='ay')

        self.assertTrue(db.table_exists('t'))