summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bowen <jbowen7@gmail.com>2019-11-22 19:41:56 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-25 11:27:09 +0100
commitba5760965ed52d1b310097e060f8511f9bad7631 (patch)
treed46b6bc5a3e7a1bda2857ed71b2fe1745370db5b
parent641deb4d50e2ae3c7031739dcf9d1524492dc095 (diff)
[3.0.x] Refs #23950 --- Moved test DeconstructibleInstances class to a module level.
DeconstructibleInstances was not importable from the asserted path. Backport of 8008795a3899d979d65832ca7c4946903de206f7 from master
-rw-r--r--tests/migrations/test_writer.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
index ca924f35ec..addf10b0f0 100644
--- a/tests/migrations/test_writer.py
+++ b/tests/migrations/test_writer.py
@@ -26,6 +26,11 @@ from django.utils.translation import gettext_lazy as _
from .models import FoodManager, FoodQuerySet
+class DeconstructibleInstances:
+ def deconstruct(self):
+ return ('DeconstructibleInstances', [], {})
+
+
class Money(decimal.Decimal):
def deconstruct(self):
return (
@@ -726,10 +731,6 @@ class WriterTests(SimpleTestCase):
# Yes, it doesn't make sense to use a class as a default for a
# CharField. It does make sense for custom fields though, for example
# an enumfield that takes the enum class as an argument.
- class DeconstructibleInstances:
- def deconstruct(self):
- return ('DeconstructibleInstances', [], {})
-
string = MigrationWriter.serialize(models.CharField(default=DeconstructibleInstances))[0]
self.assertEqual(string, "models.CharField(default=migrations.test_writer.DeconstructibleInstances)")