mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 01:39:18 +02:00
Less DB queries in test factories
This commit is contained in:
parent
b6902009ac
commit
d4eff5aa32
9 changed files with 61 additions and 54 deletions
|
@ -28,3 +28,14 @@ def ManyToManyFromList(field_name):
|
|||
field.add(*extracted)
|
||||
|
||||
return inner
|
||||
|
||||
|
||||
class NoUpdateOnCreate:
|
||||
"""
|
||||
Factory boy calls save after the initial create. In most case, this
|
||||
is not needed, so we disable this behaviour
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def _after_postgeneration(cls, instance, create, results=None):
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue