Exemplo n.º 1
0
 def test_render_col_autoinc_false_mysql(self):
     c = Column('some_key', Integer, primary_key=True, autoincrement=False)
     Table('some_table', MetaData(), c)
     result = autogenerate._render_column(c, self.autogen_context)
     eq_(
         result, 'sa.Column(\'some_key\', sa.Integer(), '
         'autoincrement=False, '
         'nullable=False)')
Exemplo n.º 2
0
 def test_render_col_with_server_default(self):
     c = Column('updated_at',
                TIMESTAMP(),
                server_default='TIMEZONE("utc", CURRENT_TIMESTAMP)',
                nullable=False)
     result = autogenerate._render_column(c, self.autogen_context)
     eq_(
         result, 'sa.Column(\'updated_at\', sa.TIMESTAMP(), '
         'server_default=\'TIMEZONE("utc", CURRENT_TIMESTAMP)\', '
         'nullable=False)')
 def test_render_col_autoinc_false_mysql(self):
     c = Column('some_key', Integer, primary_key=True, autoincrement=False)
     Table('some_table', MetaData(), c)
     result = autogenerate._render_column(
                 c, self.autogen_context
             )
     eq_(
         result,
         'sa.Column(\'some_key\', sa.Integer(), '
             'autoincrement=False, '
             'nullable=False)'
     )
Exemplo n.º 4
0
 def test_render_col_with_server_default(self):
     c = Column('updated_at', TIMESTAMP(),
             server_default='TIMEZONE("utc", CURRENT_TIMESTAMP)',
             nullable=False)
     result = autogenerate._render_column(
                 c, self.autogen_context
             )
     eq_(
         result,
         'sa.Column(\'updated_at\', sa.TIMESTAMP(), '
             'server_default=\'TIMEZONE("utc", CURRENT_TIMESTAMP)\', '
             'nullable=False)'
     )