diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-12-31 10:01:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-31 10:01:31 +0100 |
| commit | d88ec42bd0a37340c8477a6f20bf26e58bd84735 (patch) | |
| tree | abd9422f7fb34a19579a74515ce84d9f472cd226 /tests/custom_lookups | |
| parent | 81ccf92f154c6d9eac3e30bac0aa67574d0ace15 (diff) | |
Used addCleanup() in tests where appropriate.
Diffstat (limited to 'tests/custom_lookups')
| -rw-r--r-- | tests/custom_lookups/tests.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/custom_lookups/tests.py b/tests/custom_lookups/tests.py index a636977b67..8fc31d4e6b 100644 --- a/tests/custom_lookups/tests.py +++ b/tests/custom_lookups/tests.py @@ -460,9 +460,7 @@ class YearLteTests(TestCase): def setUp(self): models.DateField.register_lookup(YearTransform) - - def tearDown(self): - models.DateField._unregister_lookup(YearTransform) + self.addCleanup(models.DateField._unregister_lookup, YearTransform) @unittest.skipUnless( connection.vendor == "postgresql", "PostgreSQL specific SQL used" |
