mirror of https://github.com/django/django.git
Added UUIDField.deconstruct()
This commit is contained in:
parent
235124d3ea
commit
0f54cf28c0
|
@ -2366,6 +2366,11 @@ class UUIDField(Field):
|
||||||
kwargs['max_length'] = 32
|
kwargs['max_length'] = 32
|
||||||
super(UUIDField, self).__init__(**kwargs)
|
super(UUIDField, self).__init__(**kwargs)
|
||||||
|
|
||||||
|
def deconstruct(self):
|
||||||
|
name, path, args, kwargs = super(UUIDField, self).deconstruct()
|
||||||
|
del kwargs['max_length']
|
||||||
|
return name, path, args, kwargs
|
||||||
|
|
||||||
def get_internal_type(self):
|
def get_internal_type(self):
|
||||||
return "UUIDField"
|
return "UUIDField"
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,14 @@ class TestSaveLoad(TestCase):
|
||||||
self.assertEqual(loaded.field, None)
|
self.assertEqual(loaded.field, None)
|
||||||
|
|
||||||
|
|
||||||
|
class TestMigrations(TestCase):
|
||||||
|
|
||||||
|
def test_deconstruct(self):
|
||||||
|
field = models.UUIDField()
|
||||||
|
name, path, args, kwargs = field.deconstruct()
|
||||||
|
self.assertEqual(kwargs, {})
|
||||||
|
|
||||||
|
|
||||||
class TestQuerying(TestCase):
|
class TestQuerying(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.objs = [
|
self.objs = [
|
||||||
|
|
Loading…
Reference in New Issue