From 02981aae349f4a0b6afddbfa768d8c7b92d49e2e Mon Sep 17 00:00:00 2001 From: David Barnes <barnesdavidj@gmail.com> Date: Mon, 15 Jul 2024 16:03:19 -0400 Subject: [PATCH] Add test to verify that python dump and dd do nothing when DEBUG is set to False. --- tests/test_views/test_general.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/test_views/test_general.py diff --git a/tests/test_views/test_general.py b/tests/test_views/test_general.py new file mode 100644 index 0000000..8831250 --- /dev/null +++ b/tests/test_views/test_general.py @@ -0,0 +1,24 @@ +""" +Tests for general DD functionality. +""" + +# Third-Party Imports. +from django.test import override_settings +from django_expanded_test_cases import IntegrationTestCase + + +class DumpDieGeneralTestCase(IntegrationTestCase): + """Verify handling of dumped "simple" types.""" + + url = "django_dump_die:simple-type-example" + + @override_settings(DEBUG=False) + def test_debug_off_skips_all_dumps(self): + """Verify no dumps occur when debug is off.""" + self.assertGetResponse( + self.url, + expected_title="Sample page", + expected_header="Sample page", + expected_content=["<p>Sample page body content</p>"], + expected_not_content=["<div><h1>Django DumpDie</h1></div>"], + ) -- GitLab