Use `Course Factory`: https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/tests/factories.py?source=c#L50-L61