diff --git a/CHANGELOG.md b/CHANGELOG.md index b508162..a0e35bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Deprecation warning: BUILD_WITH_GEO_LIBRARIES is now deprecated. See warning for details. - Clean up build log output - Update Python versions in README to match docs +- Django version detection fixed, link updated # 167 (2020-03-26) diff --git a/bin/steps/pip-install b/bin/steps/pip-install index 9d49892..b33422a 100755 --- a/bin/steps/pip-install +++ b/bin/steps/pip-install @@ -38,10 +38,10 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then mcount "failure.none-version" fi - if grep -q 'django==1.*' requirements.txt; then + if grep -qi '^django==1.*' requirements.txt; then puts-warn "Your Django version is nearing the end of its community support." puts-warn "Upgrade to continue to receive security updates and for the best experience with Django." - puts-warn "For more information, check out https://www.djangoproject.com/weblog/2015/jun/25/roadmap/" + puts-warn "For more information, check out https://www.djangoproject.com/download/#supported-versions" fi if [ ! -f "$BUILD_DIR/.heroku/python/bin/pip" ]; then diff --git a/test/fixtures/not-old-django/requirements.txt b/test/fixtures/not-old-django/requirements.txt new file mode 100644 index 0000000..52a0c57 --- /dev/null +++ b/test/fixtures/not-old-django/requirements.txt @@ -0,0 +1,2 @@ +pwned-passwords-django==1.4 +Django==2.1 diff --git a/test/fixtures/old-django/requirements.txt b/test/fixtures/old-django/requirements.txt new file mode 100644 index 0000000..f305b2f --- /dev/null +++ b/test/fixtures/old-django/requirements.txt @@ -0,0 +1 @@ +Django==1.11 diff --git a/test/run-features b/test/run-features index c3ee1f2..8982eb0 100755 --- a/test/run-features +++ b/test/run-features @@ -74,6 +74,18 @@ testNoRequirements() { assertCapturedError } +testWarnOldDjango() { + compile "old-django" + assertCaptured "Your Django version is nearing the end of its community support." + assertCapturedSuccess +} + +testDontWarnOldDjango() { + compile "not-old-django" + assertNotCaptured "Your Django version is nearing the end of its community support." + assertCapturedSuccess +} + pushd $(dirname 0) >/dev/null popd >/dev/null