-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |