MCPcopy Create free account
hub / github.com/FactoryBoy/factory_boy / get_or_create

Method get_or_create

tests/test_using.py:67–73  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

65
66 class FakeModelManager:
67 def get_or_create(self, **kwargs):
68 defaults = kwargs.pop('defaults', {})
69 kwargs.update(defaults)
70 instance = FakeModel.create(**kwargs)
71 instance.id = 2
72 instance._defaults = defaults
73 return instance, True
74
75 def create(self, **kwargs):
76 instance = FakeModel.create(**kwargs)

Callers

nothing calls this directly

Calls 2

updateMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected