refactor: rename ItemFactory to BlockFactory

This commit is contained in:
Arunmozhi
2022-12-01 11:15:04 +05:30
committed by Agrendalath
parent 4a41208cf9
commit d417a7561f
145 changed files with 1351 additions and 1348 deletions

View File

@@ -9,7 +9,7 @@ from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.tests.factories import CourseFactory, BlockFactory # lint-amnesty, pylint: disable=wrong-import-order
class BaseCourseUpdatesTestCase(SharedModuleStoreTestCase):
@@ -23,9 +23,9 @@ class BaseCourseUpdatesTestCase(SharedModuleStoreTestCase):
cls.course = CourseFactory.create()
with cls.store.bulk_operations(cls.course.id):
# Create a basic course structure
chapter = ItemFactory.create(category='chapter', parent_location=cls.course.location)
section = ItemFactory.create(category='sequential', parent_location=chapter.location)
ItemFactory.create(category='vertical', parent_location=section.location)
chapter = BlockFactory.create(category='chapter', parent_location=cls.course.location)
section = BlockFactory.create(category='sequential', parent_location=chapter.location)
BlockFactory.create(category='vertical', parent_location=section.location)
@classmethod
def setUpTestData(cls):

View File

@@ -9,7 +9,7 @@ from django.test.client import RequestFactory
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.factories import CourseFactory, BlockFactory
from .. import url_helpers
@@ -90,22 +90,22 @@ class GetCoursewareUrlTests(SharedModuleStoreTestCase):
display_name='URL Helpers Test Course',
)
with cls.store.bulk_operations(course_run.id):
section = ItemFactory.create(
section = BlockFactory.create(
parent_location=course_run.location,
category='chapter',
display_name="Generated Section",
)
subsection = ItemFactory.create(
subsection = BlockFactory.create(
parent_location=section.location,
category='sequential',
display_name="Generated Subsection",
)
unit = ItemFactory.create(
unit = BlockFactory.create(
parent_location=subsection.location,
category='vertical',
display_name="Generated Unit",
)
component = ItemFactory.create(
component = BlockFactory.create(
parent_location=unit.location,
category='problem',
display_name="Generated Problem Component",