def billing_account(web_user_creator, web_user_contact, currency=None, save=True): account_name = data_gen.arbitrary_unique_name(prefix="BA")[:40] currency = currency or Currency.objects.get(code=settings.DEFAULT_CURRENCY) billing_account = BillingAccount( name=account_name, created_by=web_user_creator.username, currency=currency, ) if save: billing_account.save() billing_contact = BillingContactInfo( account=billing_account, first_name=data_gen.arbitrary_firstname(), last_name=data_gen.arbitrary_lastname(), emails=web_user_creator.username, phone_number="+15555555", company_name="Company Name", first_line="585 Mass Ave", city="Cambridge", state_province_region="MA", postal_code="02139", country="US", ) billing_contact.save() billing_account.billing_admins =\ [BillingAccountAdmin.objects.get_or_create(web_user=web_user_contact.username)[0]] billing_account.save() return billing_account
def arbitrary_contact_info(account, web_user_creator): return BillingContactInfo( account=account, first_name=data_gen.arbitrary_firstname(), last_name=data_gen.arbitrary_lastname(), email_list=[web_user_creator.username], phone_number="+15555555", company_name="Company Name", first_line="585 Mass Ave", city="Cambridge", state_province_region="MA", postal_code="02139", country="US", )
def arbitrary_contact_info(account, web_user_creator): return BillingContactInfo( account=account, first_name=data_gen.arbitrary_firstname(), last_name=data_gen.arbitrary_lastname(), emails=web_user_creator.username, phone_number="+15555555", company_name="Company Name", first_line="585 Mass Ave", city="Cambridge", state_province_region="MA", postal_code="02139", country="US", )