Commit e907a235 by Dave Gadling

Add a test for Query.filter(foo__in=[list_of_Objects])

It currently fails because:
  TypeError: <Game:XKz5Hfyxqw> is not JSON serializable
parent 37d06062
...@@ -375,6 +375,13 @@ class TestQuery(unittest.TestCase): ...@@ -375,6 +375,13 @@ class TestQuery(unittest.TestCase):
gm.delete() gm.delete()
ParseBatcher().batch_delete(maps) ParseBatcher().batch_delete(maps)
def testQueryByRelated(self):
game_scores_direct = GameScore.Query.filter(game=self.game)
self.assertTrue(len(game_scores_direct) > 0)
game_scores_in = GameScore.Query.filter(game__in=[self.game])
self.assertEqual(len(game_scores_in), len(game_scores_direct))
class TestFunction(unittest.TestCase): class TestFunction(unittest.TestCase):
def setUp(self): def setUp(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment