#NEWLINE# def test_create_domain_check( self ) : #NEWLINE# #INDENT# 'Create a domain with a CHECK constraint' #NEWLINE# inmap = self . std_map ( ) #NEWLINE# inmap [ 'schema public' ] . update ( { #NEWLINE# #INDENT# 'domain d1' : { #NEWLINE# #INDENT# 'type' : 'integer' , #NEWLINE# 'check_constraints' : { #NEWLINE# #INDENT# 'd1_check' : { #NEWLINE# #INDENT# 'expression' : '(VALUE >= 1888)' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# sql = self . to_sql ( inmap ) #NEWLINE# assert ( fix_indent ( sql [ 0 ] ) == ( CREATE_STMT + ' CONSTRAINT d1_check CHECK (VALUE >= 1888)' ) )