generators.py 682 B

123456789101112131415
  1. from model_bakery import baker
  2. from model_bakery.random_gen import gen_datetime, gen_integer, gen_related, gen_slug
  3. def currency_code():
  4. return "USD"
  5. baker.generators.add("organizations.fields.SlugField", gen_slug)
  6. baker.generators.add("apps.organizations_ext.fields.OrganizationSlugField", gen_slug)
  7. baker.generators.add("djstripe.fields.StripeCurrencyCodeField", currency_code)
  8. baker.generators.add("djstripe.fields.StripeIdField", gen_slug)
  9. baker.generators.add("djstripe.fields.StripeDateTimeField", gen_datetime)
  10. baker.generators.add("djstripe.fields.StripeQuantumCurrencyAmountField", gen_integer)
  11. baker.generators.add("djstripe.fields.StripeForeignKey", gen_related)