Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GitRon committed Nov 19, 2024
1 parent 0324c27 commit e1734af
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Empty file added tests/checks/__init__.py
Empty file.
27 changes: 27 additions & 0 deletions tests/checks/test_settings.py
Original file line number Diff line number Diff line change
@@ -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,
)

0 comments on commit e1734af

Please sign in to comment.