def setUp(self): self.app = app2 self.w_without_scoping = TestApp(self.app) self.w = TestApp(self.app, db=db, use_session_scopes=True) self.app_context = self.app.app_context() self.app_context.push() db.create_all()
def test_init(self): w = TestApp(self.app) self.assertEqual(w.get('/').status_code, 200) original_server_name = self.app.config['SERVER_NAME'] try: self.app.config['SERVER_NAME'] = 'webtest-app.local' w = TestApp(self.app) self.assertEqual(w.get('/').status_code, 200) finally: self.app.config['SERVER_NAME'] = original_server_name
class ResourcesTestCase(TestCase): app = app.create_app() web_client = TestApp(app) def setUp(self): super(ResourcesTestCase, self).setUp()
def get_test_app(): def test_loader(app): return load_themes_from(os.path.join(os.path.dirname(__file__), '../themes/')) Themes(main.app, app_identifier='yelplove', loaders=[test_loader]) return TestApp(main.app)
def setUp(self): self.w = TestApp(self.app)
def setUp(self): self.w = TestApp(self.app) self.user = UserFactory(password="******") self.user.save()
def setup_class(cls): cls.appcls.testing_prep() cls.app = flask.current_app cls.testapp = TestApp(flask.current_app)
def webapp(): return TestApp(_app)
def setUp(self): self.app = create_app() self.w = TestApp(self.app) self.app.config['TESTING'] = True
def client(app): client = TestApp(app) return client
def setup_app_and_ctx(self): self.app = self.create_app() self.ctx = self.app.app_context() self.ctx.push() self.w = TestApp(self.app)
def client(app): client = TestApp(app, db=models.db, use_session_scopes=True) return client