Skip to content

Instantly share code, notes, and snippets.

@piotrkilczuk
Last active May 20, 2021 11:07
Show Gist options
  • Save piotrkilczuk/2be29dd9f34b5c8195bf8670b200f10a to your computer and use it in GitHub Desktop.
Save piotrkilczuk/2be29dd9f34b5c8195bf8670b200f10a to your computer and use it in GitHub Desktop.
factories_call_v3.py
>>> club = ClubFactory()
>>> players = PlayerFactory.create_batch(10, club=club)
>>> player_male = next(filter(lambda p: p.sex == SEX_MALE, players))
>>> player_female = next(filter(lambda p: p.sex == SEX_FEMALE, players))
>>> player_male.sex, player_male.dob, player_male.government_id
('M', datetime.datetime(1998, 4, 20, 2, 14, 33, tzinfo=<UTC>), 9804200019)
>>> player_female.sex, player_female.dob, player_female.government_id
('F', datetime.datetime(1991, 2, 3, 16, 41, 55, tzinfo=<UTC>), 9102030002)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment