Permalink
Browse files

Adding a quick test for update

  • Loading branch information...
1 parent 2ff7f1d commit 15ee768214ed7f62eedec69b75e79d2445cc6aa8 @coleifer committed Oct 2, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 tests.py
View
@@ -650,7 +650,12 @@ def test_select(self):
self.assertEqual([u.username for u in users], ['u3', 'u4', 'u5'])
def test_update(self):
- pass # TODO
+ self.create_users(5)
+ uq = User.update(username='u-edited').where(User.username << ['u1', 'u2', 'u3'])
+ self.assertEqual([u.username for u in User.select().order_by(User.id)], ['u1', 'u2', 'u3', 'u4', 'u5'])
+
+ uq.execute()
+ self.assertEqual([u.username for u in User.select().order_by(User.id)], ['u-edited', 'u-edited', 'u-edited', 'u4', 'u5'])
def test_insert(self):
pass # TODO

0 comments on commit 15ee768

Please sign in to comment.