Skip to content

Commit 2abcf47

Browse files
committed
minor fixes based on review of #2082
1 parent bb0b1e8 commit 2abcf47

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/document/instance.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ class User(self.Person):
15781578
self.assertEqual(person.age, 21)
15791579
self.assertEqual(person.active, False)
15801580

1581-
def test__get_changed_fields_same_ids_reference_field_does_not_enters_infinite_loop(self):
1581+
def test__get_changed_fields_same_ids_reference_field_does_not_enters_infinite_loop_embedded_doc(self):
15821582
# Refers to Issue #1685
15831583
class EmbeddedChildModel(EmbeddedDocument):
15841584
id = DictField(primary_key=True)
@@ -1588,9 +1588,11 @@ class ParentModel(Document):
15881588
EmbeddedChildModel)
15891589

15901590
emb = EmbeddedChildModel(id={'1': [1]})
1591-
ParentModel(child=emb)._get_changed_fields()
1591+
changed_fields = ParentModel(child=emb)._get_changed_fields()
1592+
self.assertEqual(changed_fields, [])
15921593

1593-
def test__get_changed_fields_same_ids_reference_field_does_not_enters_infinite_loop_full_caseEmailUser(self):
1594+
def test__get_changed_fields_same_ids_reference_field_does_not_enters_infinite_loop_different_doc(self):
1595+
# Refers to Issue #1685
15941596
class User(Document):
15951597
id = IntField(primary_key=True)
15961598
name = StringField()

0 commit comments

Comments
 (0)