'Test we can delete an attribute in a time range.'

@DeletionTest
def testDeleteAttributesTimestamps(self):

    predicate = 'metadata:tspredicate'
    data_store.DB.Set(self.test_row, predicate, 'hello1000', timestamp=1000, replace=False, token=self.token)
    data_store.DB.Set(self.test_row, predicate, 'hello2000', timestamp=2000, replace=False, token=self.token)
    data_store.DB.Set(self.test_row, predicate, 'hello3000', timestamp=3000, replace=False, token=self.token)
    data_store.DB.Set(self.test_row, predicate, 'hello4000', timestamp=4000, replace=False, token=self.token)
    self.CheckLast(predicate, 'hello4000', 4000)
    self.CheckLength(predicate, 4)
    data_store.DB.DeleteAttributes(self.test_row, [predicate], start=0, end=1500, sync=True, token=self.token)
    self.CheckLast(predicate, 'hello4000', 4000)
    self.CheckLength(predicate, 3)
    data_store.DB.DeleteAttributes(self.test_row, [predicate], start=3000, end=4500, sync=True, token=self.token)
    self.CheckLast(predicate, 'hello2000', 2000)
    self.CheckLength(predicate, 1)
    data_store.DB.DeleteAttributes(self.test_row, [predicate], start=0, end=5000, sync=True, token=self.token)
    self.CheckLast(predicate, None, 0)
    self.CheckLength(predicate, 0)
