From c36f760114163c3f70520fd8ff28de8466e09e4d Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Thu, 12 May 2016 07:45:48 -0400 Subject: [PATCH] Add bdd test for page not containing plaintext. You can now use 'the page should not contain the plaintext ...' in a feature test. --- tests/integration/features/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index 060bb00dd..12a3c906b 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -366,6 +366,14 @@ def check_contents_plain(quteproc, text): assert text in content +@bdd.then(bdd.parsers.parse('the page should not contain the plaintext ' + '"{text}"')) +def check_contents_plain(quteproc, text): + """Check the current page's content based on a substring.""" + content = quteproc.get_content().strip() + assert text not in content + + @bdd.then(bdd.parsers.parse('the json on the page should be:\n{text}')) def check_contents_json(quteproc, text): """Check the current page's content as json."""