As suganti said, you can use mock.
But I propose another solution:
@classmethod def _create(cls, model_class, *args, **kwargs): with mock.patch('MyModel.is_smth', new_callable=mock.PropertyMock) as m: m.return_value = True return super()._create(model_class, *args, **kwargs)
Just a layout of the property during generation models. It works on factoryboy==2.5.2
source share