Пример #1
0
 def test_coerce_parent(self, client):
     """ coerce a dict holding an parent path """
     root = Node.root()
     a = root.add("a")
     res = MainHandler.coerce(dict(parent="a"))
     assert 'parent' in res
     assert res['parent'] == a
     assert 'instance' not in res
Пример #2
0
 def test_coerce_instance_parent(self, client):
     """ coerce a dict holding both instance and parent """
     root = Node.root()
     a = root.add("a")
     b = a.add("b")
     res = MainHandler.coerce(dict(instance="b", parent="a"))
     assert 'instance' in res
     assert 'parent' in res
     assert res['instance'] == b
     assert res['parent'] == a