mirror of https://github.com/django/django.git
[3.0.x] Refs #23950 --- Moved test DeconstructibleInstances class to a module level.
DeconstructibleInstances was not importable from the asserted path.
Backport of 8008795a38
from master
This commit is contained in:
parent
641deb4d50
commit
ba5760965e
|
@ -26,6 +26,11 @@ from django.utils.translation import gettext_lazy as _
|
||||||
from .models import FoodManager, FoodQuerySet
|
from .models import FoodManager, FoodQuerySet
|
||||||
|
|
||||||
|
|
||||||
|
class DeconstructibleInstances:
|
||||||
|
def deconstruct(self):
|
||||||
|
return ('DeconstructibleInstances', [], {})
|
||||||
|
|
||||||
|
|
||||||
class Money(decimal.Decimal):
|
class Money(decimal.Decimal):
|
||||||
def deconstruct(self):
|
def deconstruct(self):
|
||||||
return (
|
return (
|
||||||
|
@ -726,10 +731,6 @@ class WriterTests(SimpleTestCase):
|
||||||
# Yes, it doesn't make sense to use a class as a default for a
|
# 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
|
# CharField. It does make sense for custom fields though, for example
|
||||||
# an enumfield that takes the enum class as an argument.
|
# 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]
|
string = MigrationWriter.serialize(models.CharField(default=DeconstructibleInstances))[0]
|
||||||
self.assertEqual(string, "models.CharField(default=migrations.test_writer.DeconstructibleInstances)")
|
self.assertEqual(string, "models.CharField(default=migrations.test_writer.DeconstructibleInstances)")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue