Skip to content

Commit 460a136

Browse files
committed
add test for ObjectIdAutoField.deconstruct()
1 parent f35b419 commit 460a136

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/model_fields_/test_autofield.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55

66
class MethodTests(SimpleTestCase):
7+
def test_deconstruct(self):
8+
field = ObjectIdAutoField()
9+
name, path, args, kwargs = field.deconstruct()
10+
self.assertEqual(path, "django_mongodb.fields.auto.ObjectIdAutoField")
11+
self.assertEqual(args, [])
12+
self.assertEqual(kwargs, {"db_column": "_id", "primary_key": True})
13+
714
def test_to_python(self):
815
f = ObjectIdAutoField()
916
self.assertEqual(f.to_python("1"), 1)

0 commit comments

Comments
 (0)