From 4e6a1f49831e6326e3f0211343cddef4624d6871 Mon Sep 17 00:00:00 2001
From: John Bowen <jbowen7@gmail.com>
Date: Fri, 22 Nov 2019 19:41:56 +0000
Subject: [PATCH] Fixed WriterTests.test_deconstruct_class_arguments to assert
against a proper import path. A prior commit exposed that it was enforcing
bad design.
---
tests/migrations/test_writer.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
index 99c9cbf..d082da1 100644
a
|
b
|
class IntEnum(enum.IntEnum):
|
61 | 61 | B = 2 |
62 | 62 | |
63 | 63 | |
| 64 | class DeconstructibleInstances: |
| 65 | def deconstruct(self): |
| 66 | return ('DeconstructibleInstances', [], {}) |
| 67 | |
| 68 | |
64 | 69 | class OperationWriterTests(SimpleTestCase): |
65 | 70 | |
66 | 71 | def test_empty_signature(self): |
… |
… |
class WriterTests(SimpleTestCase):
|
733 | 738 | # Yes, it doesn't make sense to use a class as a default for a |
734 | 739 | # CharField. It does make sense for custom fields though, for example |
735 | 740 | # an enumfield that takes the enum class as an argument. |
736 | | class DeconstructibleInstances: |
737 | | def deconstruct(self): |
738 | | return ('DeconstructibleInstances', [], {}) |
739 | | |
740 | 741 | string = MigrationWriter.serialize(models.CharField(default=DeconstructibleInstances))[0] |
741 | 742 | self.assertEqual(string, "models.CharField(default=migrations.test_writer.DeconstructibleInstances)") |
742 | 743 | |