Permalink
Browse files

[1.8.x] Added UUIDField.deconstruct()

Backport of 0f54cf2 from master
  • Loading branch information...
timgraham committed Feb 5, 2015
1 parent c9addfd commit fc1e9107d7d750f6eed3c8e679dfe96af8f05150
Showing with 13 additions and 0 deletions.
  1. +5 −0 django/db/models/fields/__init__.py
  2. +8 −0 tests/model_fields/test_uuid.py
@@ -2374,6 +2374,11 @@ def __init__(self, **kwargs):
kwargs['max_length'] = 32
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):
return "UUIDField"
@@ -35,6 +35,14 @@ def test_null_handling(self):
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):
def setUp(self):
self.objs = [

0 comments on commit fc1e910

Please sign in to comment.