#NEWLINE# def test_valid_post( self ) : #NEWLINE# #INDENT# 'Valid delivery reports should create reports in the DB.' #NEWLINE# msg = self . create_outgoing_message ( ) #NEWLINE# query = { #NEWLINE# #INDENT# 'message_id' : query . id , #NEWLINE# 'identity' : msg . connections [ 0 ] . identity , #NEWLINE# 'status' : 1 , #NEWLINE# 'status_text' : 'Success' , #NEWLINE# 'smsc' : 'usb0-modem' , #NEWLINE# 'sms_id' : self . random_string ( 36 ) , #NEWLINE# 'date_sent' : now ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# url = reverse ( 'kannel-delivery-report' ) #NEWLINE# response = self . client . get ( url , query ) #NEWLINE# self . assertEqual ( 200 , response . status_code ) #NEWLINE# self . assertEqual ( 1 , DeliveryReport . objects . count ( ) ) #NEWLINE# report = DeliveryReport . objects . all ( ) [ 0 ] #NEWLINE# self . assertEqual ( msg . id , report . message_id )