

def testFilterByNumber(self):
    root = TestEntityGroupRoot(id='root')
    TestModel(parent=root.key).put()
    TestModel(number=17, parent=root.key).put()
    query = TestModel.query(ancestor=root.key).filter((TestModel.number == 42))
    results = query.fetch(2)
    self.assertEqual(1, len(results))
    self.assertEqual(42, results[0].number)

dataset/ETHPy150Open GoogleCloudPlatform/python-docs-samples/appengine/localtesting/datastore_test.py DatastoreTestCase.testFilterByNumber/original