Beispiel #1
0
def shell_account():
    account = Account.by_name(SHELL_USER)
    if account is not None:
        return account
    account = Account()
    account.name = SHELL_USER
    db.session.add(account)
    return account
Beispiel #2
0
def shell_account():
    account = Account.by_name(SHELL_USER)
    if account is not None:
        return account
    account = Account()
    account.name = SHELL_USER
    db.session.add(account)
    return account
 def test_settings(self, model_mock, update_mock):
     account = Account()
     account.name = 'mockaccount'
     db.session.add(account)
     db.session.commit()
     model_mock.return_value = account
     update_mock.return_value = True
     response = self.app.get(url(controller='account', action='settings'),
                             extra_environ={'REMOTE_USER': '******'})
Beispiel #4
0
def make_account(name='test', fullname='Test User', email='*****@*****.**'):
    from openspending.model import Account
    account = Account()
    account.name = name
    account.fullname = fullname
    account.email = email
    db.session.add(account)
    db.session.commit()
    return account
Beispiel #5
0
 def test_settings(self, model_mock, update_mock):
     account = Account()
     account.name = 'mockaccount'
     db.session.add(account)
     db.session.commit()
     model_mock.return_value = account
     update_mock.return_value = True
     response = self.app.get(url(controller='account', action='settings'),
                             extra_environ={'REMOTE_USER': '******'})
Beispiel #6
0
 def test_settings(self, model_mock, update_mock):
     account = Account()
     account.name = "mockaccount"
     db.session.add(account)
     db.session.commit()
     model_mock.return_value = account
     update_mock.return_value = True
     response = self.app.get(
         url(controller="account", action="settings"), extra_environ={"REMOTE_USER": "******"}
     )
Beispiel #7
0
def make_account(name='test', fullname='Test User',
                 email='*****@*****.**'):
    from openspending.model import Account
    account = Account()
    account.name = name
    account.fullname = fullname
    account.email = email
    db.session.add(account)
    db.session.commit()
    return account
Beispiel #8
0
def make_account(name="test", fullname="Test User", email="*****@*****.**", twitter="testuser", admin=False):
    from openspending.model import Account

    # First see if the account already exists and if so, return it
    account = Account.by_name(name)
    if account:
        return account

    # Account didn't exist so we create it and return it
    account = Account()
    account.name = name
    account.fullname = fullname
    account.email = email
    account.twitter_handle = twitter
    account.admin = admin
    db.session.add(account)
    db.session.commit()

    return account
Beispiel #9
0
def make_account(name='test',
                 fullname='Test User',
                 email='*****@*****.**',
                 twitter='testuser',
                 admin=False):
    from openspending.model import Account

    # First see if the account already exists and if so, return it
    account = Account.by_name(name)
    if account:
        return account

    # Account didn't exist so we create it and return it
    account = Account()
    account.name = name
    account.fullname = fullname
    account.email = email
    account.twitter_handle = twitter
    account.admin = admin
    db.session.add(account)
    db.session.commit()

    return account