def test_add_unique_constraint_unicode_schema(self): m = MetaData() t = Table('t', m, Column('c', Integer), schema=compat.ue('\u0411\u0435\u0437')) eq_ignore_whitespace( autogenerate.render._add_unique_constraint(UniqueConstraint(t.c.c), self.autogen_context), "op.create_unique_constraint(None, 't', ['c'], " "schema=%r)" % compat.ue('\u0411\u0435\u0437'))
def test_render_table_w_unicode_name(self): m = MetaData() t = Table(compat.ue('\u0411\u0435\u0437'), m, Column('id', Integer, primary_key=True), ) eq_ignore_whitespace( autogenerate.render._add_table(t, self.autogen_context), "op.create_table(%r," "sa.Column('id', sa.Integer(), nullable=False)," "sa.PrimaryKeyConstraint('id'))" % compat.ue('\u0411\u0435\u0437') )
def test_add_unique_constraint_unicode_schema(self): m = MetaData() t = Table( 't', m, Column('c', Integer), schema=compat.ue('\u0411\u0435\u0437') ) eq_ignore_whitespace( autogenerate.render._add_unique_constraint( UniqueConstraint(t.c.c), self.autogen_context ), "op.create_unique_constraint(None, 't', ['c'], " "schema=%r)" % compat.ue('\u0411\u0435\u0437') )
def test_render_unicode_server_default(self): default = compat.ue('\u0411\u0435\u0437 ' '\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f') c = Column('x', Unicode, server_default=text(default)) eq_ignore_whitespace( autogenerate.render._render_server_default(c.server_default, self.autogen_context), "sa.text(%r)" % default)
def test_render_unicode_server_default(self): default = compat.ue( '\u0411\u0435\u0437 ' '\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f' ) c = Column( 'x', Unicode, server_default=text(default) ) eq_ignore_whitespace( autogenerate.render._render_server_default( c.server_default, self.autogen_context ), "sa.text(%r)" % default )