Search⌘ K

Application Configuration and Integration Tests

Let’s learn how to configure the application and perform integration tests.

Application configuration

Docker Compose, the testing framework, and the application itself are configured through a single JSON file that we need to update with the actual values we want to use for MongoDB.

JavaScript (JSX)
[
{
"name": "FLASK_ENV",
"value": "production"
},
{
"name": "FLASK_CONFIG",
"value": "testing"
},
{
"name": "POSTGRES_DB",
"value": "postgres"
},
{
"name": "POSTGRES_USER",
"value": "postgres"
},
{
"name": "POSTGRES_HOSTNAME",
"value": "localhost"
},
{
"name": "POSTGRES_PORT",
"value": "5433"
},
{
"name": "POSTGRES_PASSWORD",
"value": "postgres"
},
{
"name": "MONGODB_USER",
"value": "root"
},
{
"name": "MONGODB_HOSTNAME",
"value": "localhost"
},
{
"name": "MONGODB_PORT",
"value": "27018"
},
{
"name": "MONGODB_PASSWORD",
"value": "mongodb"
},
{
"name": "APPLICATION_DB",
"value": "test"
}
]

Since the standard port for MongoDB is 27017, we choose 27018 for the tests in our example. In a real scenario, ...