Skip to content

Commit

Permalink
Added test for upsert & update_one #336
Browse files Browse the repository at this point in the history
  • Loading branch information
rozza committed Jun 3, 2013
1 parent 2fe1c20 commit b2f78fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/queryset/queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,15 @@ def test_upsert(self):
self.assertEqual("Bob", bob.name)
self.assertEqual(30, bob.age)

def test_upsert_one(self):
self.Person.drop_collection()

self.Person.objects(name="Bob", age=30).update_one(upsert=True)

bob = self.Person.objects.first()
self.assertEqual("Bob", bob.name)
self.assertEqual(30, bob.age)

def test_set_on_insert(self):
self.Person.drop_collection()

Expand Down

0 comments on commit b2f78fa

Please sign in to comment.