Skip to content

Commit 1a568d7

Browse files
committed
Added test for get_or_create for Peewee - #31
1 parent d686807 commit 1a568d7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_peewee.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,7 @@ def test_where(self):
6868
create_items()
6969
items = Item.select().where(Item.embedding.l2_distance([1, 1, 1]) < 1)
7070
assert [v.id for v in items] == [1]
71+
72+
def test_get_or_create(self):
73+
Item.get_or_create(id=1, defaults={'embedding': [1, 2, 3]})
74+
Item.get_or_create(embedding=np.array([4, 5, 6]))

0 commit comments

Comments
 (0)