Populate a non-production environment with fake data.

gratipay.fake_data.insert_fake_data(db, tablename, **kw)[source]

Insert fake data into the database.

  • db (Postgres) – a Postgres or Cursor object
  • tablename (unicode) – the name of the table to insert into
  • kw (dict) – a mapping of column names to values
gratipay.fake_data.fake_text_id(size=6, chars='abcdefghijklmnopqrstuvwxyz0123456789')[source]

Create a random text id.

gratipay.fake_data.fake_sentence(start=1, stop=100)[source]

Create a sentence of random length.

gratipay.fake_data.fake_participant(db, is_admin=False, random_identities=True)[source]

Create a fake User.

  • db (Postgres) – a Postgres or Cursor object
  • is_admin (bool) – whether to make the participant an admin
  • random_identities (bool) – whether to give the participant random identities
gratipay.fake_data.fake_participant_identity(participant, verification=None)[source]

Pick a country and make an identity for the participant there.

  • participant (Participant) – a participant object
  • verification (bool) – the value to set verification to; None will result in a 50% chance either way

a country id

gratipay.fake_data.fake_team(db, teamowner, teamname=None)[source]

Create a fake team

gratipay.fake_data.fake_payment_instruction(db, participant, team)[source]

Create a fake payment_instruction

gratipay.fake_data.fake_elsewhere(db, participant, platform)[source]

Create a fake elsewhere.

gratipay.fake_data.fake_payment(db, participant, team, timestamp, amount, payday, direction)[source]

Create fake payment

gratipay.fake_data.fake_exchange(db, participant, amount, fee, timestamp)[source]

Create a fake exchange for a participant

gratipay.fake_data.populate_db(db, nparticipants=100, ntips=200, nteams=100, npackages=5)[source]

Populate DB with fake data.