vbv/server/vbv_lernwelt/learnpath/tests/learning_path_factories.py

102 lines
2.5 KiB
Python

import factory
import wagtail_factories
from vbv_lernwelt.learnpath.models import LearningPath, Topic, Circle, LearningSequence, LearningContent, LearningUnit
from vbv_lernwelt.learnpath.models_learning_unit_content import VideoBlock, WebBasedTrainingBlock, PodcastBlock, \
CompetenceBlock, ExerciseBlock, DocumentBlock, KnowledgeBlock
class LearningPathFactory(wagtail_factories.PageFactory):
title = "Versicherungsvermittler/in"
class Meta:
model = LearningPath
class TopicFactory(wagtail_factories.PageFactory):
title = "Gewinnen von Kunden"
is_visible = True
class Meta:
model = Topic
class CircleFactory(wagtail_factories.PageFactory):
title = "Gewinnen"
class Meta:
model = Circle
class LearningSequenceFactory(wagtail_factories.PageFactory):
title = "Grundlagen"
class Meta:
model = LearningSequence
class LearningUnitFactory(wagtail_factories.PageFactory):
title = 'Lerneinheit'
class Meta:
model = LearningUnit
class LearningContentFactory(wagtail_factories.PageFactory):
title = "Herzlich Willkommen"
class Meta:
model = LearningContent
class VideoBlockFactory(wagtail_factories.StructBlockFactory):
url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam"
class Meta:
model = VideoBlock
class WebBasedTrainingBlockFactory(wagtail_factories.StructBlockFactory):
url = "https://www.example.com"
description = "Beispiel Rise Modul"
class Meta:
model = WebBasedTrainingBlock
class PodcastBlockFactory(wagtail_factories.StructBlockFactory):
description = "Beispiel Podcast"
url = "https://docs.wagtail.org/en/stable/topics/streamfield.html"
class Meta:
model = PodcastBlock
class CompetenceBlockFactory(wagtail_factories.StructBlockFactory):
description = "Beispiel Kompetenz"
class Meta:
model = CompetenceBlock
class ExerciseBlockFactory(wagtail_factories.StructBlockFactory):
description = "Beispiel Aufgabe"
class Meta:
model = ExerciseBlock
class DocumentBlockFactory(wagtail_factories.StructBlockFactory):
description = "Beispiel Dokument"
class Meta:
model = DocumentBlock
class KnowledgeBlockFactory(wagtail_factories.StructBlockFactory):
description = "Beispiel Wissen"
class Meta:
model = KnowledgeBlock