def test_category_delete_with_forum(forum):
 forum.category.delete()
 assert (forum is not None)
 assert (forum.category is not None)
 category = Category.query.filter_by(id=forum.category.id).first()
 forum = Forum.query.filter_by(id=forum.id).first()
 assert (forum is None)
 assert (category is None)

def test_category_delete_with_forum ( forum ) : forum . category . delete ( ) assert ( forum is not None ) assert ( forum . category is not None ) category = Category . query . filter_by ( id = forum . category . id ) . first ( ) forum = Forum . query . filter_by ( id = forum . id ) . first ( ) assert ( forum is None ) assert ( category is None )
when deleting a category .