From 45f48ed4f7dda33c536ae14a72c26dc5574c8312 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 25 Feb 2021 09:52:59 +0000 Subject: [PATCH] Made F deconstruction omit 'expressions' in the path. --- django/db/models/expressions.py | 2 +- tests/expressions/tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index a3317bc28c..c7e33b3698 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -578,7 +578,7 @@ class TemporalSubtraction(CombinedExpression): return connection.ops.subtract_temporals(self.lhs.output_field.get_internal_type(), lhs, rhs) -@deconstructible +@deconstructible(path='django.db.models.F') class F(Combinable): """An object capable of resolving references to existing query objects.""" diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index 33c5189390..30a3f0ad61 100644 --- a/tests/expressions/tests.py +++ b/tests/expressions/tests.py @@ -991,7 +991,7 @@ class FTests(SimpleTestCase): def test_deconstruct(self): f = F('name') path, args, kwargs = f.deconstruct() - self.assertEqual(path, 'django.db.models.expressions.F') + self.assertEqual(path, 'django.db.models.F') self.assertEqual(args, (f.name,)) self.assertEqual(kwargs, {})