'Get StudentModule object for test course, given the `username` and the problem\'s `descriptor`.'

def get_student_module(self, username, descriptor):

    return StudentModule.objects.get(course_id=self.course.id, student=User.objects.get(username=username), module_type=descriptor.location.category, module_state_key=descriptor.location)
