'Tests that command does not break if a user has no profile.'

def test_no_user_profile(self):

    self._create_courses_and_enrollments((self.TEST_ORG, True))
    self._set_opt_in_pref(self.user, self.TEST_ORG, True)
    self.assertTrue(hasattr(self.user, 'profile'))
    self.user.profile.delete()
    user = User.objects.get(id=self.user.id)
    self.assertFalse(hasattr(user, 'profile'))
    output = self._run_command(self.TEST_ORG)
    self._assert_output(output, (user, self.courses[0].id, True))
