Merge pull request #1348 from hramezani/add_config_test

Add test for `config.from_object`.
This commit is contained in:
7 2018-10-07 19:53:58 -07:00 committed by GitHub
commit 5cc12fd945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,16 @@ def test_overwrite_exisiting_config(app):
assert app.config.DEFAULT == 2 assert app.config.DEFAULT == 2
def test_overwrite_exisiting_config_ignore_lowercase(app):
app.config.default = 1
class Config:
default = 2
app.config.from_object(Config)
assert app.config.default == 1
def test_missing_config(app): def test_missing_config(app):
with pytest.raises(AttributeError) as e: with pytest.raises(AttributeError) as e:
app.config.NON_EXISTENT app.config.NON_EXISTENT