Mrs. Dubose probably never expected to become addicted to morphine since it was originally given to her by her doctor (presumably Dr. Reynolds) to relieve her pain. Like Mrs. Dubose, Atticus never expected to have to take on a case like that of Tom Robinson's, but it was also given to him.
"I'd hoped to get through life without a case of this kind, but John Taylor pointed at me and said 'You're It.' "
Mrs. Dubose's morphine addiction and Atticus's decision to defend Tom are similar in one big way. As Atticus explained to Jem,
"... real courage is... when you know you're licked before you begin but you begin anyway and see it through no matter what. You rarely win, but sometimes you do."
Atticus knew he could not win the Tom Robinson case, but he still saw it through to the end. According to Atticus, Mrs. Dubose died a winner, kicking the morphine habit even though she knew that in the end, she still would not survive her other ailments.