'Assert that the correct email was sent to confirm an email change'

def assertChangeEmailSent(self, email_user):

    context = {'old_email': self.user.email, 'new_email': self.pending_change_request.new_email}
    self.assertEmailUser(email_user, 'emails/email_change_subject.txt', context, 'emails/confirm_email_change.txt', context)
    request = RequestFactory().post('unused_url')
    request.user = self.user
    request.META['HTTP_HOST'] = 'aGenericValidHostName'
    self.append_allowed_hosts('aGenericValidHostName')
    with patch('edxmako.request_context.get_current_request', return_value=request):
        body = render_to_string('emails/confirm_email_change.txt', context)
        url = safe_get_host(request)
    self.assertIn(url, body)
