Example #1
0
 def test_model_on_db(self):
     model = SomeModel()
     model.put()
     cmd = SingleModelSearchCommand(SomeModel.query())
     result = cmd()
     # is a list because SingleModel inherits from ModelSearchCommand
     self.assertListEqual([model.key], memcache.get(cmd._cache_key())[0])
     self.assertEqual(model, result)
Example #2
0
 def test_no_model_on_db(self):
     cmd = SingleModelSearchCommand(SomeModel.query())
     result = cmd()
     self.assertIsNone(result)
     self.assertIsNone(memcache.get(cmd._cache_key()))