Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
self.config = testing.setUp()
def setUp(self):
self.config = testing.setUp()
from sqlalchemy import create_engine
engine = create_engine('sqlite://')
from .models import (
Base,
MyModel,
)
DBSession.configure(bind=engine)
Base.metadata.create_all(engine)
with transaction.manager:
model = MyModel(name='one', value=55)
DBSession.add(model)
def setUpClass(self):
from openwifi import main
from webtest import TestApp
self.config = testing.setUp()
from sqlalchemy import create_engine
from openwifi.models import DBSession
DBSession.close_all()
import os
from .models import (
Base,
DBSession,
)
ROOT_PATH = os.path.dirname(__file__)
settings = appconfig('config:' + os.path.join(ROOT_PATH, 'test.ini'))
settings['openwifi.useAuth'] = 'true'
settings['openwifi.offline'] = 'true'
print(settings)
def setUp(self):
from . import includeme
self.config = testing.setUp()
includeme(self.config)
def setUp(self):
self.config = testing.setUp()
def setUp(self):
import substanced.principal
import adhocracy.websockets.client as wsclient
wsclient.disable()
self.config = testing.setUp()
self.config.include('substanced.content')
self.config.scan(substanced.principal)
self.config.include('adhocracy.registry')
self.config.include('adhocracy.resources.principal')
self.context = DummyFolder()
def setUp(self):
from pyramid.renderers import JSONP
self.config = testing.setUp(autocommit=False)
self.config.add_renderer('jsonp', JSONP(param_name='callback'))
self.config.include("cornice")
add_view(UserImp.get, renderer='json')
# pyramid does not allow having 2 views with same request conditions
add_view(UserImp.get, renderer='jsonp', accept='application/javascript')
add_view(UserImp.collection_post, renderer='json', accept='application/json')
user_resource = add_resource(
UserImp, collection_path='/users', path='/users/{id}',
name='user_service', factory=dummy_factory)
self.config.add_cornice_resource(user_resource)
self.app = TestApp(CatchErrors(self.config.make_wsgi_app()))
def config(request):
config = testing.setUp()
config.include('pyramid_oauthlib')
request.addfinalizer(testing.tearDown)
return config
def setUp(self):
self.config = testing.setUp()
def setUp(self):
self.session = _initTestingDB()
self.config = testing.setUp()
from pyramid.paster import get_app
app = get_app('development.ini')
from webtest import TestApp
self.testapp = TestApp(app)