Exemplo n.º 1
0
 def test_create_rename_delete(self):
     tree = Tree(alias='mytree')
     tree.save(force_insert=True)
     self.assertIsNotNone(tree.id)
     self.assertEqual(tree.alias, 'mytree')
     tree.alias = 'not_mytree'
     tree.save(force_update=True)
     self.assertEqual(tree.alias, 'not_mytree')
     tree.delete()
     self.assertIsNone(tree.id)
Exemplo n.º 2
0
 def test_create_rename_delete(self):
     tree = Tree(alias='mytree')
     tree.save(force_insert=True)
     self.assertIsNotNone(tree.id)
     self.assertEqual(tree.alias, 'mytree')
     tree.alias = 'not_mytree'
     tree.save(force_update=True)
     self.assertEqual(tree.alias, 'not_mytree')
     tree.delete()
     self.assertIsNone(tree.id)
Exemplo n.º 3
0
def delete_tree_by_name(name):
    trees_deleted = Tree.delete().where(Tree.name==name).execute()
    return trees_deleted > 0