示例#1
0
 def test_render_check_constraint_literal(self):
     eq_ignore_whitespace(
         autogenerate._render_check_constraint(
             CheckConstraint("im a constraint"),
             self.autogen_context
         ),
         "sa.CheckConstraint('im a constraint')"
     )
示例#2
0
 def test_render_check_constraint_literal(self):
     eq_ignore_whitespace(
         autogenerate._render_check_constraint(
             CheckConstraint("im a constraint", name='cc1'),
             self.autogen_context
         ),
         "sa.CheckConstraint('im a constraint', name='cc1')"
     )
示例#3
0
 def test_render_check_constraint_sqlexpr(self):
     c = column('c')
     five = literal_column('5')
     ten = literal_column('10')
     eq_ignore_whitespace(
         autogenerate._render_check_constraint(
             CheckConstraint(and_(c > five, c < ten)),
             self.autogen_context),
         "sa.CheckConstraint('c > 5 AND c < 10')")
示例#4
0
 def test_render_check_constraint_sqlexpr(self):
     c = column('c')
     five = literal_column('5')
     ten = literal_column('10')
     eq_ignore_whitespace(
         autogenerate._render_check_constraint(
             CheckConstraint(and_(c > five, c < ten)),
             self.autogen_context
         ),
         "sa.CheckConstraint('c > 5 AND c < 10')"
     )