'Convenience method to generate a MockPartitionService for a user.'

def _create_service(self, username, cache=None):

    user_id = abs(hash(username))
    self.user = Mock(username=username, email='{}@edx.org'.format(username), is_staff=False, is_active=True, id=user_id)
    self.course.user_partitions = [self.user_partition]
    return MockPartitionService(self.course, course_id=self.course.id, cache=cache)
