'Test sending to a non-existent person'

def testProcessingEmailToInvalidPerson(self):

    s3db = current.s3db
    resource = s3db.resource('pr_person', uid=['MsgTestPerson1'])
    row = resource.select(['pe_id'], as_rows=True).first()
    self.sent = []
    outbox = s3db.msg_outbox
    outbox_id = outbox.insert(pe_id=row.pe_id, message_id=self.message_id)
    outbox_id = outbox.insert(pe_id=None, message_id=self.message_id)
    msg = current.msg
    msg.send_email = self.send_email
    msg.process_outbox()
    self.assertEqual(len(self.sent), 1)
    self.assertTrue(('test1@example.com' in self.sent))
