'Test that change to email calls update_user_email'

@patch('lms.djangoapps.email_marketing.tasks.update_user_email.delay')
def test_modify_email(self, mock_update_user):

    email_marketing_user_field_changed(None, self.user, table='auth_user', setting='email', old_value='new@a.com')
    mock_update_user.assert_called_with(self.user.email, 'new@a.com')
    mock_update_user.reset_mock()
    update_email_marketing_config(enabled=False)
    email_marketing_user_field_changed(None, self.user, table='auth_user', setting='email', old_value='new@a.com')
    self.assertFalse(mock_update_user.called)
