1

I am not able to unit test a particular block of code in my project. Here is the snippet of code:

@process_bp.route("/getListCSV")
def get_list_csv():
    industry_sele = "All"
    #rest of code
    if industry_sele != "All":
        companies_flask_list = Companies.query.filter(Companies.industry_desc == industry_sele)

I have tried all the ways of writing a unit testcase for this from here-> How to mock <ModelClass>.query.filter_by() in Flask-SqlAlchemy The test case passed but the testcase didn't cover the snippet of code. What could be the reason for that? How to do it in a proper way? please help

0 Answers0