Skip to content

Commit b60af4d

Browse files
committed
Nested equality check
1 parent 2226a66 commit b60af4d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/unit/core/test_domain.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,14 @@ def test__eq__(self):
163163
assert a1 != ActionDomain(id=2, name="action")
164164
assert a1 != ActionDomain(id=1, name="something")
165165
assert a1 != SomeOtherDomain(id=1, name="action")
166+
167+
def test_nested__eq__(self):
168+
child1 = ActionDomain(id=1, name="child")
169+
d1 = SomeOtherDomain(id=1, name="parent", child=child1)
170+
d2 = SomeOtherDomain(id=1, name="parent", child=child1)
171+
172+
assert d1 == d2
173+
174+
d2.child = ActionDomain(id=2, name="child2")
175+
176+
assert d1 != d2

0 commit comments

Comments
 (0)