

def check_redis_structure(self, obj, be):
    session = obj.session
    backend = be.backend
    keys = backend.instance_keys(obj)
    self.assertTrue((be.id in keys))
    lkeys = (yield backend.model_keys(self.model._meta))
    self.assertFalse((be.id in lkeys))
    (yield self.adddata(obj))
    if (backend.name == 'redis'):
        lkeys = (yield backend.model_keys(self.model._meta))
        self.assertTrue((be.id in lkeys))
    (yield session.delete(obj))
    lkeys = (yield backend.model_keys(self.model._meta))
    self.assertFalse((be.id in lkeys))

dataset/ETHPy150Open lsbardel/python-stdnet/tests/all/multifields/struct.py MultiFieldMixin.check_redis_structure/original