2018-04-09 22:09:58 +02:00
|
|
|
import os
|
|
|
|
|
2021-01-02 19:28:03 +01:00
|
|
|
from flask import Flask
|
|
|
|
|
2018-04-09 22:09:58 +02:00
|
|
|
|
2020-05-10 15:55:56 +02:00
|
|
|
class TestConfig:
|
2021-01-02 19:28:03 +01:00
|
|
|
def test_development_config(self, app: Flask) -> None:
|
2020-09-16 15:41:02 +02:00
|
|
|
app.config.from_object('fittrackee.config.DevelopmentConfig')
|
2020-05-10 15:55:56 +02:00
|
|
|
assert app.config['DEBUG']
|
|
|
|
assert not app.config['TESTING']
|
|
|
|
assert app.config['SQLALCHEMY_DATABASE_URI'] == os.environ.get(
|
|
|
|
'DATABASE_URL'
|
|
|
|
)
|
2018-04-09 22:09:58 +02:00
|
|
|
|
2021-01-02 19:28:03 +01:00
|
|
|
def test_testing_config(self, app: Flask) -> None:
|
2020-09-16 15:41:02 +02:00
|
|
|
app.config.from_object('fittrackee.config.TestingConfig')
|
2020-05-10 15:55:56 +02:00
|
|
|
assert app.config['DEBUG']
|
|
|
|
assert app.config['TESTING']
|
|
|
|
assert not app.config['PRESERVE_CONTEXT_ON_EXCEPTION']
|
|
|
|
assert app.config['SQLALCHEMY_DATABASE_URI'] == os.environ.get(
|
|
|
|
'DATABASE_TEST_URL'
|
|
|
|
)
|