1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #30350 -- Prevented recreation of migration for operations with a range object.

Thanks to Mariusz Felisiak for helping with the patch.
This commit is contained in:
Florian Apolloner
2019-04-13 15:03:26 +02:00
committed by Mariusz Felisiak
parent 1afbc96a75
commit 2e38f2015a
3 changed files with 10 additions and 1 deletions

View File

@@ -451,6 +451,11 @@ class WriterTests(SimpleTestCase):
self.assertSerializedEqual(one_item_tuple)
self.assertSerializedEqual(many_items_tuple)
def test_serialize_range(self):
string, imports = MigrationWriter.serialize(range(1, 5))
self.assertEqual(string, 'range(1, 5)')
self.assertEqual(imports, set())
def test_serialize_builtins(self):
string, imports = MigrationWriter.serialize(range)
self.assertEqual(string, 'range')