Add pipeline run and operation run factories
@@ -2,7 +2,7 @@ import factory
from factories.factory_projects import ProjectFactory
from factories.factory_users import UserFactory
-from pipelines.models import Pipeline, Operation
+from pipelines.models import Pipeline, Operation, PipelineRun, OperationRun
class PipelineFactory(factory.DjangoModelFactory):
@@ -18,3 +18,18 @@ class OperationFactory(factory.DjangoModelFactory):
class Meta:
model = Operation
+
+
+class PipelineRunFactory(factory.DjangoModelFactory):
+ pipeline = factory.SubFactory(PipelineFactory)
+
+ class Meta:
+ model = PipelineRun
+
+
+class OperationRunFactory(factory.DjangoModelFactory):
+ operation = factory.SubFactory(OperationFactory)
+ pipeline_run = factory.SubFactory(PipelineRunFactory)
+
+ class Meta:
+ model = OperationRun
