def test_save_restore(self):
    subs = [MockAsyncResultSuccess(uuid(), app=self.app), MockAsyncResultSuccess(uuid(), app=self.app)]
    ts = self.app.GroupResult(uuid(), subs)
    ts.save()
    with self.assertRaises(AttributeError):
        ts.save(backend=object())
    self.assertEqual(self.app.GroupResult.restore(ts.id).subtasks, ts.subtasks)
    ts.delete()
    self.assertIsNone(self.app.GroupResult.restore(ts.id))
    with self.assertRaises(AttributeError):
        self.app.GroupResult.restore(ts.id, backend=object())
def test_save_restore(self):
    subs = [MockAsyncResultSuccess(uuid(), app=self.app), MockAsyncResultSuccess(uuid(), app=self.app)]
    ts = self.app.GroupResult(uuid(), subs)
    ts.save()
    with self.assertRaises(AttributeError):
        ts.save(backend=object())
    self.assertEqual(self.app.GroupResult.restore(ts.id).subtasks, ts.subtasks)
    ts.delete()
    self.assertIsNone(self.app.GroupResult.restore(ts.id))
    with self.assertRaises(AttributeError):
        self.app.GroupResult.restore(ts.id, backend=object())