コード例 #1
0
os.environ["DATABASE"] = "sqlite:///%s" % testdb
import unittest
import tempfile

from flask import url_for

from app import settingsapp
from flaskwallet import app
from flaskwallet import init_db
from flaskwallet import session
from settingsapp.models import Setting
from walletapp.app import walletapp

from sqlalchemy.exc import IntegrityError

app.register_blueprint(settingsapp)
app.register_blueprint(walletapp)
app.config['TESTING'] = True


def setUpModule():
    init_db()


class CreateTest(unittest.TestCase):
    def test_setval_dupe(self):
        newsetting = Setting('testkey', u'teststring')
        session.add(newsetting)
        session.commit()
        newsetting = Setting('testkey', u'teststring')
        session.add(newsetting)
コード例 #2
0
ファイル: tests.py プロジェクト: CryptArc/flaskwallet
from flaskwallet import init_db
from flaskwallet import session
from otpapp.app import otpapp
from settingsapp.app import settingsapp
from walletapp.app import walletapp
from walletapp.app import coinformat
from walletapp.forms.wallet import WalletForm
from walletapp.helpers import strtofloat
from walletapp.lib.connection import get_connection
from walletapp.models import Wallet

from sqlalchemy.exc import IntegrityError
from sqlalchemy.exc import InvalidRequestError


app.register_blueprint(otpapp)
app.register_blueprint(settingsapp)
app.register_blueprint(walletapp)
app.config['TESTING'] = True
pp = 'testpassphrase'

def setUpModule():
    init_db()
    ctx = app.test_request_context()
    ctx.push()
    wallet1 = Wallet(
        'box1',
        'admin1',
        '123',
        'localhost',
        19001,