'Checks that the task will be aborted and not retried if the username
passed was not found, and that an exception is logged.'

def test_abort_if_invalid_username(self, *mock_helpers):

    with mock.patch((TASKS_MODULE + '.LOGGER.exception')) as mock_exception:
        tasks.award_program_certificates.delay('nonexistent-username').get()
        self.assertTrue(mock_exception.called)
    for mock_helper in mock_helpers:
        self.assertFalse(mock_helper.called)
