def setUp(self):
    super(SentEmailModelValidatorTests, self).setUp()

    def mock_generate_hash(unused_cls, unused_recipient_id, unused_email_subject, unused_email_body):
        return 'Email Hash'
    self.sender_email = 'example@example.com'
    self.sender_id = 'sender'
    self.sender_model = user_models.UserSettingsModel(id=self.sender_id, email=self.sender_email)
    self.sender_model.put()
    self.recipient_email = 'example@example.com'
    self.recipient_id = 'recipient'
    self.recipient_model = user_models.UserSettingsModel(id=self.recipient_id, email=self.recipient_email)
    self.recipient_model.put()
    with self.swap(email_models.SentEmailModel, '_generate_hash', types.MethodType(mock_generate_hash, email_models.SentEmailModel)):
        email_models.SentEmailModel.create(self.recipient_id, self.recipient_email, self.sender_id, self.sender_email, feconf.EMAIL_INTENT_SIGNUP, 'Email Subject', 'Email Body', datetime.datetime.utcnow())
    self.model_instance = email_models.SentEmailModel.get_by_hash('Email Hash')[0]
    self.job_class = prod_validation_jobs_one_off.SentEmailModelAuditOneOffJob
def setUp(self):
    super(SentEmailModelValidatorTests, self).setUp()

    def mock_generate_hash(unused_cls, unused_recipient_id, unused_email_subject, unused_email_body):
        return 'Email Hash'
    self.sender_email = 'example@example.com'
    self.sender_id = 'sender'
    self.sender_model = user_models.UserSettingsModel(id=self.sender_id, email=self.sender_email)
    self.sender_model.put()
    self.recipient_email = 'example@example.com'
    self.recipient_id = 'recipient'
    self.recipient_model = user_models.UserSettingsModel(id=self.recipient_id, email=self.recipient_email)
    self.recipient_model.put()
    with self.swap(email_models.SentEmailModel, '_generate_hash', types.MethodType(mock_generate_hash, email_models.SentEmailModel)):
        email_models.SentEmailModel.create(self.recipient_id, self.recipient_email, self.sender_id, self.sender_email, feconf.EMAIL_INTENT_SIGNUP, 'Email Subject', 'Email Body', datetime.datetime.utcnow())
    self.model_instance = email_models.SentEmailModel.get_by_hash('Email Hash')[0]
    self.job_class = prod_validation_jobs_one_off.SentEmailModelAuditOneOffJob