#NEWLINE# def test_create_event_duplicate( self ) : #NEWLINE# #INDENT# message_id = '9876-0001-0001' #NEWLINE# event_type = 'test.thing.begin' #NEWLINE# timestamp = datetime . datetime ( 2014 , 7 , 4 , 12 , 7 , 21 , 4096 ) #NEWLINE# traits = dict ( test_string = 'foobar' , test_number = 42 , test_float = 3.1415 , test_date = datetime . datetime ( 2014 , 7 , 1 , 0 , 0 , 0 , 0 ) , somevalue = 'A fine test string' ) #NEWLINE# self . db . create_event ( message_id , event_type , timestamp , traits ) #NEWLINE# with self . assertRaises ( db . DuplicateError ) : #NEWLINE# #INDENT# self . db . create_event ( message_id , event_type , timestamp , traits )