

def testUniqueFilter(self):
    objects = self.mapper[SimpleModel]
    (yield self.async.assertEqual(objects.filter(code='test4').count(), 0))
    (yield objects.update_or_create(code='test4'))
    (yield self.async.assertEqual(objects.filter(code='test4').count(), 1))
    (yield self.async.assertEqual(objects.filter(code='foo').count(), 0))

dataset/ETHPy150Open lsbardel/python-stdnet/tests/all/query/manager.py TestManager.testUniqueFilter/original