예제 #1
0
 def contacts_and_accounts(self, size, tenant):
     # create various contacts
     ContactFactory.create_batch(size, tenant=tenant)
     # create accounts with zero contact
     AccountFactory.create_batch(size, tenant=tenant)
     # create account with multi contacts
     function_factory(tenant).create_batch(size, account=AccountFactory(tenant=tenant))
예제 #2
0
 def contacts_and_accounts(self, size, tenant):
     # create various contacts
     ContactFactory.create_batch(size, tenant=tenant)
     # create accounts with zero contact
     AccountFactory.create_batch(size, tenant=tenant)
     # create account with multi contacts
     function_factory(tenant).create_batch(
         size, account=AccountFactory(tenant=tenant))
     # create account with assigned_to
     function_factory(tenant).create_batch(
         size,
         account=AccountFactory(tenant=tenant,
                                assigned_to=LilyUserFactory(tenant=tenant)))
예제 #3
0
    def accounts_account(self, **kwargs):
        kwargs.update({
            'size': kwargs.get('size', self.batch_size) / 2,
            'tenant': kwargs.get('tenant', self.tenant),
            'assigned_to': kwargs.get('assigned_to') if kwargs.get('assigned_to') else iterator(self.users_user),
        })
        accounts_with_users = AccountFactory.create_batch(**kwargs)

        del kwargs['assigned_to']
        accounts_without_users = AccountFactory.create_batch(**kwargs)

        self.stdout.write('Done with accounts_account.')

        return accounts_with_users + accounts_without_users
예제 #4
0
    def accounts_account(self, **kwargs):
        kwargs.update({
            'size': kwargs.get('size', self.batch_size) / 2,
            'tenant': kwargs.get('tenant', self.tenant),
            'assigned_to': kwargs.get('assigned_to') if kwargs.get('assigned_to') else iterator(self.users_user),
        })
        accounts_with_users = AccountFactory.create_batch(**kwargs)

        del kwargs['assigned_to']
        accounts_without_users = AccountFactory.create_batch(**kwargs)

        self.stdout.write('Done with accounts_account.')

        return accounts_with_users + accounts_without_users
예제 #5
0
    def accounts_account(self, **kwargs):
        kwargs.update(
            {
                "size": kwargs.get("size", self.batch_size) / 2,
                "tenant": kwargs.get("tenant", self.tenant),
                "assigned_to": kwargs.get("assigned_to") if kwargs.get("assigned_to") else iterator(self.users_user),
            }
        )
        accounts_with_users = AccountFactory.create_batch(**kwargs)

        del kwargs["assigned_to"]
        accounts_without_users = AccountFactory.create_batch(**kwargs)

        self.stdout.write("Done with accounts_account.")

        return accounts_with_users + accounts_without_users
예제 #6
0
 def contacts_and_accounts(self, size, tenant):
     # create various contacts
     ContactFactory.create_batch(size, tenant=tenant)
     # create accounts with zero contact
     AccountFactory.create_batch(size, tenant=tenant)
     # create account with multi contacts
     FunctionFactory.create_batch(
         size,
         tenant=tenant,
         account=AccountFactory(tenant=tenant),
     )
     # create account with assigned_to
     FunctionFactory.create_batch(
         size,
         tenant=tenant,
         account=AccountFactory(
             tenant=tenant,
             assigned_to=LilyUserFactory(tenant=tenant)
         ),
     )