Esempio n. 1
0
 def setUp(self):
     super(OrderStartTestCase, self).setUp()
     self.user = create_user("*****@*****.**")
     self.user2 = create_user("*****@*****.**")
     self.invalid_mail_user = create_user("email")
     self.account = create_account("accountname", "email")
     self.account2 = create_account("accountname2", "email")
     self.account.subscription = Subscription(FREE)
Esempio n. 2
0
 def setUp(self):
     super(OrderStartTestCase, self).setUp()
     self.user = create_user("*****@*****.**")
     self.user2 = create_user("*****@*****.**")
     create_currency("EUR", "Euro")
     self.account = create_account("accountname", "email")
     self.account2 = create_account("accountname2", "email")
     self.event = start_event(self.account.id, "event_name")
     self.eventpart = add_eventpart(self.event.id)
     self.tickettype = create_tickettype(50, 10)
     self.tickettype.is_active = True
     link_tickettype_to_event(self.tickettype, self.event)
Esempio n. 3
0
 def setUp(self):
     super(TicketMailingTestCase, self).setUp()
     self.user = create_user("*****@*****.**")
     self.invalid_mail_user = create_user("invalidexample.com")
     self.account = create_account("accountname", "email")
     self.account.subscription = Subscription(FREE)
     create_currency("EUR", "Euro")
     self.event = start_event(self.account.id, "event_name")
     self.eventpart = add_eventpart(self.event.id)
     self.tickettype = create_tickettype(50, 10)
     self.tickettype.is_active = True
     link_tickettype_to_event(self.tickettype, self.event)
Esempio n. 4
0
def account_create(user_id, account_info):
    """
    Entrypoint for creating an account and returning its information back as a
    dictionary. 
    
    Args:
        user_id:
            Id of the user who will own the account
        account_info:
            Dictionary containing the following keys:
                -  short_name (required)
                -  email (required)
                -  name
                -  url
                -  vat
                -  subtitle
                -  handling_fee
    """
    # create account
    account = create_account(account_info.get('short_name'),
                             account_info.get('email'))
    # add optional information
    account.full_name = account_info.get('name')
    account.website = account_info.get('url')
    account.vat_percentage = account_info.get('vat')
    account.meta['subtitle'] = account_info.get('subtitle')
    account.meta['theme'] = account_info.get('theme')
    account.set_handling_fee(account_info.get('handling_fee') or 0)
    # add default subscription
    account.subscription = Subscription(FREE)
    # create default oauth2 client
    client = create_oauth_client()
    account.client_id = client.id
    # connect user to account
    user = lookup_user_by_id(user_id)
    assoc = UserAccountAssociation()
    assoc.user = user
    assoc.account_id = account.id
    account.users.append(assoc)
    # set preferred payment service provider
    account.meta['preferred_psp'] = account_info.get('preferred_psp')
    # create psp object
    create_payment_provider(account, {}, account_info.get('preferred_psp'))
    # set currency
    account.set_currency(account_info.get('currency'))
    # send account welcome mail
    send_account_welcome_mail.apply_async(args=[user.id, account.id],
                                          countdown=10)

    account_info = account_to_dict(account)
    return account_info
Esempio n. 5
0
 def setUp(self):
     super(TicketTypeModelTestCase, self).setUp()
     create_currency("EUR", "Euro")
     self.account = create_account("accountname", "email")
     self.event = start_event(self.account.id, "event name")
     add_eventpart(self.event.id)
Esempio n. 6
0
 def test_unlimited_transactions(self):
     account = create_account("account2", "email")
     account.subscription = Subscription(PREMIUMPRO)
     self.assertTrue(has_available_transactions(account))
Esempio n. 7
0
 def setUp(self):
     super(SubscriptionModelTestCase, self).setUp()
     self.account = create_account("accountname", "email")
     self.account.subscription = Subscription(FREE)
     self.today = datetime.date.today()
Esempio n. 8
0
File: tasks.py Progetto: Tickee/BLM
 def setUp(self):
     super(PaymentProviderTasksTestCase, self).setUp()
     self.account = create_account("accountname", "email")
     self.user = create_user("*****@*****.**")
     self.user2 = create_user("*****@*****.**")
     self.order = start_order(self.user, self.account)
Esempio n. 9
0
 def setUp(self):
     super(TransactionStatisticsTestCase, self).setUp()
     self.user = create_user("*****@*****.**")
     self.account = create_account("accountname", "email")