def test_VersionedNode_push(self):
     self.printLine()
     props = {'foo': 'bar', 'other': 2}
     node = VersionedNode.push(**props)
     print node.uuid, node.timestamp
     assert node.foo == 'bar' and node.other == 2
     self.printLine()
 def test_VersionedNode_push(self):
     self.printLine()
     props = {'foo': 'bar', 'other': 2}
     node = VersionedNode.push(**props)
     print node.uuid, node.timestamp
     assert node.foo == 'bar' and node.other == 2
     self.printLine()
 def test_VersionedNode_change(self):
     self.printLine()
     props = {'foo': 'bar', 'other': 2}
     node = VersionedNode.push(**props)
     print node.uuid, node.timestamp
     setattr(node, 'foo', 'no_bar')
     setattr(node, 'other', 4)
     node.save()
     assert node.foo == 'no_bar' and node.other == 4
     self.printLine()
 def test_VersionedNode_change(self):
     self.printLine()
     props = {'foo': 'bar', 'other': 2}
     node = VersionedNode.push(**props)
     print node.uuid, node.timestamp
     setattr(node, 'foo', 'no_bar')
     setattr(node, 'other', 4)
     node.save()
     assert node.foo == 'no_bar' and node.other == 4
     self.printLine()
 def test_VersionedNode_parent(self):
     self.printLine()
     props = {'foo': 'bar', 'other': 2}
     node = VersionedNode.push(**props)
     print node.uuid, node.timestamp
     setattr(node, 'foo', 'no_bar')
     setattr(node, 'other', 3)
     node.save()
     node_prev = node.parent.single()
     assert node_prev.foo == props['foo']
     assert node_prev.other == props['other']
     self.printLine()
 def test_VersionedNode_parent(self):
     self.printLine()
     props = {'foo': 'bar', 'other': 2}
     node = VersionedNode.push(**props)
     print node.uuid, node.timestamp
     setattr(node, 'foo', 'no_bar')
     setattr(node, 'other', 3)
     node.save()
     node_prev = node.parent.single()
     assert node_prev.foo == props['foo']
     assert node_prev.other == props['other']
     self.printLine()
    def test_VersionedNode_history(self):
        self.printLine()
        props = {'foo': 'bar', 'other': 2}
        node = VersionedNode.push(**props)
        print node.uuid, node.timestamp
        setattr(node, 'foo', 'no_bar')
        setattr(node, 'other', 3)
        node.save()
        node_prev = node.parent.single()
        history = node._get_change_history()
        #:TODO Asserts.
        setattr(node, 'x', 'new')
        setattr(node, 'other', 3)
        delattr(node,'foo')
        node.save()
        history = node._get_change_history()

        self.printLine()
    def test_VersionedNode_history(self):
        self.printLine()
        props = {'foo': 'bar', 'other': 2}
        node = VersionedNode.push(**props)
        print node.uuid, node.timestamp
        setattr(node, 'foo', 'no_bar')
        setattr(node, 'other', 3)
        node.save()
        node_prev = node.parent.single()
        history = node._get_change_history()
        #:TODO Asserts.
        setattr(node, 'x', 'new')
        setattr(node, 'other', 3)
        delattr(node, 'foo')
        node.save()
        history = node._get_change_history()

        self.printLine()