示例#1
0
    def test_remove(self):
        document = self._create(n=0)
        ref = document["ref"]

        # Change it
        new_instance = self._q(query.replace(ref, {"data": {"n": 1}}))
        self.assertEqual(self._q(query.get(ref)), new_instance)

        # Delete that event
        self._q(query.remove(ref, new_instance["ts"], "create"))

        # Assert that it was undone
        self.assertEqual(self._q(query.get(ref)), document)
 def test_remove(self):
     self.assertJson(
         query.remove(query.collection("widget"), ts=123, action="create"),
         '{"action":"create","remove":{"collection":"widget"},"ts":123}')