def test_delete_node(self): node = ProjectFactory(is_public=True, title='The Soul Album') osf_storage = node.get_addon('osfstorage') root = osf_storage.get_root() root.append_file('The Dock of the Bay.mp3') find = query_file('The Dock of the Bay.mp3')['results'] assert_equal(len(find), 1) node.is_deleted = True node.save() find = query_file('The Dock of the Bay.mp3')['results'] assert_equal(len(find), 0)
def test_get_targets(self): project1 = ProjectFactory() project2 = ProjectFactory() project1.save() project2.save() node_list1 = get_targets() assert node_list1 is not None assert len(node_list1) is 2 project1.is_deleted = True project1.save() node_list2 = get_targets() assert node_list2 is not None assert len(node_list2) is 1