def create_userstory(**kwargs):
 owner = kwargs.pop('owner', None)
 if (not owner):
  owner = UserFactory.create()
 project = kwargs.pop('project', None)
 if (project is None):
  project = ProjectFactory.create(owner=owner)
 defaults = {'project': project, 'owner': owner, 'milestone': MilestoneFactory.create(project=project, owner=owner)}
 defaults.update(kwargs)
 return UserStoryFactory(**defaults)

def create_userstory ( ** kwargs ) : owner = kwargs . pop ( 'owner' , None ) if ( not owner ) : owner = UserFactory . create ( ) project = kwargs . pop ( 'project' , None ) if ( project is None ) : project = ProjectFactory . create ( owner = owner ) defaults = { 'project' : project , 'owner' : owner , 'milestone' : MilestoneFactory . create ( project = project , owner = owner ) } defaults . update ( kwargs ) return UserStoryFactory ( ** defaults )
create an user story along with its dependencies .