from app.config import _get_max_content_length def test_max_upload_size_mb_environment_variable(monkeypatch): monkeypatch.setenv("MAX_UPLOAD_SIZE_MB", "42") monkeypatch.delenv("MAX_CONTENT_LENGTH", raising=False) assert _get_max_content_length() == 42 * 1024 * 1024 def test_max_content_length_environment_variable_is_supported(monkeypatch): monkeypatch.delenv("MAX_UPLOAD_SIZE_MB", raising=False) monkeypatch.setenv("MAX_CONTENT_LENGTH", "2048") assert _get_max_content_length() == 2048