def create_membership(**kwargs):
 project = kwargs.pop('project', ProjectFactory())
 project.points.add(PointsFactory.create(project=project, value=None))
 defaults = {'project': project, 'user': UserFactory.create(), 'role': RoleFactory.create(project=project, permissions=list(map((lambda x: x[0]), MEMBERS_PERMISSIONS)))}
 defaults.update(kwargs)
 return MembershipFactory.create(**defaults)

def create_membership ( ** kwargs ) : project = kwargs . pop ( 'project' , ProjectFactory ( ) ) project . points . add ( PointsFactory . create ( project = project , value = None ) ) defaults = { 'project' : project , 'user' : UserFactory . create ( ) , 'role' : RoleFactory . create ( project = project , permissions = list ( map ( ( lambda x : x [ 0 ] ) , MEMBERS_PERMISSIONS ) ) ) } defaults . update ( kwargs ) return MembershipFactory . create ( ** defaults )
create a membership along with its dependencies .