def testSetPropertyIndexed(self): property = datastore.Property() helper.set_property(property, 'a', 1) self.assertEquals(False, property.value.HasField('indexed')) helper.set_property(property, 'a', 1, indexed=True) self.assertEquals(False, property.value.HasField('indexed')) self.assertEquals(True, property.value.indexed) helper.set_property(property, 'a', 1, indexed=False) self.assertEquals(True, property.value.HasField('indexed')) self.assertEquals(False, property.value.indexed)
def testSetPropertyOverwrite(self): property = datastore.Property() helper.set_property(property, 'a', 1, indexed=False) helper.set_property(property, 'a', 'a') self.assertEquals('a', helper.get_value(property.value)) self.assertEquals(True, property.value.indexed)