Skip to content

Commit

Permalink
Extend keydata children() test to select from both sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Sep 24, 2019
1 parent ddf4ce3 commit ce4c21d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,15 +632,16 @@ def test_simple_update(self):
def test_children(self):
children = KeyData.data.children().alias('children')
query = (KeyData
.select(children.c.fullkey.alias('fullkey'))
.select(KeyData.key, children.c.fullkey.alias('fullkey'))
.from_(KeyData, children)
.order_by(KeyData.id, SQL('fullkey')))
accum = [row.fullkey for row in query]
accum = [(row.key, row.fullkey) for row in query]
self.assertEqual(accum, [
'$.k1', '$.x1',
'$.k2', '$.x2',
'$.k1', '$.k2',
'$.x1', '$.l1', '$.l2'])
('a', '$.k1'), ('a', '$.x1'),
('b', '$.k2'), ('b', '$.x2'),
('c', '$.k1'), ('c', '$.k2'),
('d', '$.x1'),
('e', '$.l1'), ('e', '$.l2')])

def test_tree(self):
tree = KeyData.data.tree().alias('tree')
Expand Down

0 comments on commit ce4c21d

Please sign in to comment.