def test_fromdict(self):
        header_dict = self.header_arquivo.todict()
        header_arquivo = itau.registros.HeaderArquivo(**header_dict)
        self.assertEqual(header_arquivo.cedente_nome,
                                                'TRACY TECNOLOGIA LTDA ME')
        self.assertEqual(header_arquivo.nome_do_banco, 'BANCO ITAU SA')
def delete_category(category_id):
    category = Category.query.filter_by(id=category_id).first_or_404()

    involved_users = User.query.filter(Forum.category_id == category.id,
                                       Topic.forum_id == Forum.id,
                                       Post.user_id == User.id).all()

    category.delete(involved_users)
    flash(_("Category with all associated forums deleted."), "success")
    return redirect(url_for("management.forums"))