Answer the question
In order to leave comments, you need to log in
How to set a field in Gino model when creating it via Factory?
There are two factories:
class UserFactory(factory.Factory):
class Meta:
model = models.User
.....
class ProfileFactory(factory.Factory):
class Meta:
model = models.Profile
user = factory.SubFactory(UserFactory)
ProfileFactory.build()
, Gino.CrudModel
it cannot set the value for the `user` attribute for the Profile model, i.e. there are lines:setattr(self._instance, key, value)
value = getattr(self._instance, value_from)[key] # value_from = __values__
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question