#NEWLINE# @ classmethod #NEWLINE# def setup_class( cls ) : #NEWLINE# #INDENT# con = testing . db . connect ( ) #NEWLINE# try : #NEWLINE# #INDENT# con . execute ( 'CREATE DOMAIN int_domain AS INTEGER DEFAULT 42 NOT NULL' ) #NEWLINE# con . execute ( 'CREATE DOMAIN str_domain AS VARCHAR(255)' ) #NEWLINE# con . execute ( 'CREATE DOMAIN rem_domain AS BLOB SUB_TYPE TEXT' ) #NEWLINE# con . execute ( 'CREATE DOMAIN img_domain AS BLOB SUB_TYPE BINARY' ) #NEWLINE# #UNINDENT# except ProgrammingError as e : #NEWLINE# #INDENT# if ( not ( 'attempt to store duplicate value' in str ( e ) ) ) : #NEWLINE# #INDENT# raise con #NEWLINE# #UNINDENT# #UNINDENT# con . execute ( 'CREATE GENERATOR gen_testtable_id' ) #NEWLINE# con . execute ( "CREATE TABLE testtable (question int_domain,\n                                   answer str_domain DEFAULT 'no answer',\n                                   remark rem_domain DEFAULT '',\n                                   photo img_domain,\n                                   d date,\n                                   t time,\n                                   dt timestamp,\n                                   redundant str_domain DEFAULT NULL)" ) #NEWLINE# con . execute ( 'ALTER TABLE testtable ADD CONSTRAINT testtable_pk PRIMARY KEY (question)' ) #NEWLINE# con . execute ( 'CREATE TRIGGER testtable_autoid FOR testtable    ACTIVE BEFORE INSERT AS   BEGIN     IF (NEW.question IS NULL) THEN       NEW.question = gen_id(gen_testtable_id, 1);   END' )