How can I create data for a nested factory ?
class StringLengthLimitFactory(ModelFactory[StringLengthLimit]):
__model__ = StringLengthLimit
DiagnosisType = Require()
class DiagnosisFactory(ModelFactory[Diagnosis]):
__model__ = Diagnosis
StringLengthLimit = Use(StringLengthLimitFactory.build)
class DataFactory(ModelFactory[Data]):
__model__ = Data
Activities = Ignore()
Contacts = Ignore()
Courses = Ignore()
Diagnosis = Use(DiagnosisFactory.build)
Observations = Ignore()
class ReportFactory(ModelFactory[Report]):
__model__ = Report
Data = Use(DataFactory.build)
class StringFactory(ModelFactory[INTERNTEST_v1_0_0]):
__model__ = INTERNTEST_v1_0_0
Timestamp = Ignore()
Report = Use(ReportFactory.build)
In this case StringLengthLimitFactoryis required but
data_entry = StringFactory.build(DiagnosisType = "abc")
Isnt working. I tried a lot of different attempts but I rly dont understand how you are supposed to do this. Create each factory manual seems crazy.