mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-12 12:00:37 +08:00
Move example app, which was a bad example, to the tests namespace. Its what it was used for anyway. A better example will be provided later
This commit is contained in:
+7
-7
@@ -1,6 +1,5 @@
|
||||
from unittest import TestCase
|
||||
from example import app
|
||||
|
||||
from tests.test_app.sqlalchemy import create_app
|
||||
|
||||
class SecurityTest(TestCase):
|
||||
|
||||
@@ -9,14 +8,15 @@ class SecurityTest(TestCase):
|
||||
def setUp(self):
|
||||
super(SecurityTest, self).setUp()
|
||||
|
||||
self.app = self._create_app(self.AUTH_CONFIG or None)
|
||||
self.app.debug = False
|
||||
self.app.config['TESTING'] = True
|
||||
app = self._create_app(self.AUTH_CONFIG or {})
|
||||
app.debug = False
|
||||
app.config['TESTING'] = True
|
||||
|
||||
self.client = self.app.test_client()
|
||||
self.app = app
|
||||
self.client = app.test_client()
|
||||
|
||||
def _create_app(self, auth_config):
|
||||
return app.create_sqlalchemy_app(auth_config)
|
||||
return create_app(auth_config)
|
||||
|
||||
def _get(self, route, content_type=None, follow_redirects=None, headers=None):
|
||||
return self.client.get(route, follow_redirects=follow_redirects,
|
||||
|
||||
Reference in New Issue
Block a user