clean up secret key docs

consistent key across docs and examples
consistent key across tests, set in conftest
This commit is contained in:
David Lord 2017-06-28 07:58:06 -07:00
parent cce6e7dccc
commit 465922e5f1
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
15 changed files with 41 additions and 79 deletions

View file

@ -19,11 +19,11 @@ import pytest
# config keys used for the TestConfig
TEST_KEY = 'foo'
SECRET_KEY = 'devkey'
SECRET_KEY = 'config'
def common_object_test(app):
assert app.secret_key == 'devkey'
assert app.secret_key == 'config'
assert app.config['TEST_KEY'] == 'foo'
assert 'TestConfig' not in app.config
@ -50,21 +50,21 @@ def test_config_from_json():
def test_config_from_mapping():
app = flask.Flask(__name__)
app.config.from_mapping({
'SECRET_KEY': 'devkey',
'SECRET_KEY': 'config',
'TEST_KEY': 'foo'
})
common_object_test(app)
app = flask.Flask(__name__)
app.config.from_mapping([
('SECRET_KEY', 'devkey'),
('SECRET_KEY', 'config'),
('TEST_KEY', 'foo')
])
common_object_test(app)
app = flask.Flask(__name__)
app.config.from_mapping(
SECRET_KEY='devkey',
SECRET_KEY='config',
TEST_KEY='foo'
)
common_object_test(app)
@ -81,7 +81,8 @@ def test_config_from_class():
TEST_KEY = 'foo'
class Test(Base):
SECRET_KEY = 'devkey'
SECRET_KEY = 'config'
app = flask.Flask(__name__)
app.config.from_object(Test)
common_object_test(app)