From 48a368ac713a11b0b1ab366f94e181e204ad2a66 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 24 Mar 2020 14:48:17 -0400 Subject: [PATCH] Add test for expected behavior --- test/fixtures/not-old-django/requirements.txt | 2 ++ test/fixtures/old-django/requirements.txt | 1 + test/run-features | 12 ++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 test/fixtures/not-old-django/requirements.txt create mode 100644 test/fixtures/old-django/requirements.txt 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