diff options
| author | Nicolò Intrieri <81313286+n-borges@users.noreply.github.com> | 2023-07-18 05:27:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-18 05:27:40 +0200 |
| commit | e8252fc4451ee2c05779b28e74417174f0a2eeef (patch) | |
| tree | a96025c53bc03cd8e29d2facf981c061c8382390 /tests | |
| parent | 4a72da71001f154ea60906a2f74898d32b7322a7 (diff) | |
Fixed #34716 -- Fixed serialization of nested class methods in migrations.
Co-authored-by: Nicolò <nicolo.intrieri@spinforward.it>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_writer.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py index bef8f64061..5ee814d2af 100644 --- a/tests/migrations/test_writer.py +++ b/tests/migrations/test_writer.py @@ -211,6 +211,10 @@ class WriterTests(SimpleTestCase): X = "X", "X value" Y = "Y", "Y value" + @classmethod + def method(cls): + return cls.X + def safe_exec(self, string, value=None): d = {} try: @@ -468,6 +472,15 @@ class WriterTests(SimpleTestCase): ), ) + def test_serialize_nested_class_method(self): + self.assertSerializedResultEqual( + self.NestedChoices.method, + ( + "migrations.test_writer.WriterTests.NestedChoices.method", + {"import migrations.test_writer"}, + ), + ) + def test_serialize_uuid(self): self.assertSerializedEqual(uuid.uuid1()) self.assertSerializedEqual(uuid.uuid4()) |
