Skip to content

Commit afa77f9

Browse files
Add test case for same secondary attributes between parent/child.
1 parent 43290a5 commit afa77f9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/schema.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,21 @@ class ThingC(dj.Manual):
348348
-> [unique, nullable] ThingB
349349
"""
350350

351+
352+
@schema
353+
class Parent(dj.Manual):
354+
definition = """
355+
parent_id: int
356+
---
357+
name: varchar(30)
358+
"""
359+
360+
361+
@schema
362+
class Child(dj.Manual):
363+
definition = """
364+
-> Parent
365+
child_id: int
366+
---
367+
name: varchar(30)
368+
"""

tests/test_fetch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,6 @@ def test_fetch_format(self):
243243
assert_dict_equal(l1, l2, 'Primary key is not returned correctly')
244244
# revert configuration of fetch format
245245
dj.config['fetch_format'] = 'array'
246+
247+
def test_same_secondary_attribute(self):
248+
print(schema.Child * schema.Parent().proj())

0 commit comments

Comments
 (0)