There should be a test for this method in common/djangoapps/student/models.py. The method is tested indirectly through CMS, but a test should also live in the same package as the code.

After adding a test and responding to Carlos' feedback (rocha), I think this PR will be ready to go.