From e1734afe32f114e07798844c8269e62822ba254a Mon Sep 17 00:00:00 2001 From: Ronny Vedrilla Date: Tue, 19 Nov 2024 11:35:48 +0100 Subject: [PATCH] v1.0.0 --- tests/checks/__init__.py | 0 tests/checks/test_settings.py | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/checks/__init__.py create mode 100644 tests/checks/test_settings.py diff --git a/tests/checks/__init__.py b/tests/checks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/checks/test_settings.py b/tests/checks/test_settings.py new file mode 100644 index 0000000..417f361 --- /dev/null +++ b/tests/checks/test_settings.py @@ -0,0 +1,27 @@ +from django.core import checks +from django.test import SimpleTestCase, override_settings + +from django_removals.checks.settings import check_removed_settings + + +class SettingsCheckTest(SimpleTestCase): + def test_check_removed_settings_no_warnings(self): + warnings = check_removed_settings() + + self.assertEqual(len(warnings), 0) + + @override_settings(TRANSACTIONS_MANAGED=True) + def test_check_removed_settings_with_deprecated_settings(self): + warnings = check_removed_settings() + + self.assertEqual(len(warnings), 1) + self.assertIn( + checks.Warning( + "The 'TRANSACTIONS_MANAGED' setting was removed in Django 1.4 and its use is not recommended.", + hint="Please refer to the documentation: https://docs.djangoproject.com/en/stable/releases/" + "1.4/#features-removed-in-1-4.", + obj="TRANSACTIONS_MANAGED", + id="removals.W014/transactions_managed", + ), + warnings, + )