Hi all, How to write a pytest case to get coverage report to 100%. ``` def Account_security(request): try: if ((request.session.get('email') is None) or (request.session.get('email') == "")): return HttpResponseRedirect("/home") dict_act = {} email = request.session.get('email') # save_url = save_current_url(request, email) # Based on logged in user email filtering list of objects. account = Account_history.objects.filter(email=email) # Calculating logged in time. for i in account: some_date = diff_time_Acnt(i) dict_act[i.id] = some_date return render(request, 'account_security.html', {'account': account,
'fullname': fullname(email), 'name': first_last_initial(email), 'time': settings.SESSION_IDLE_TIMEOUT, 'some_date': dict_act, }) except Exception as e: logging.error(e) return render(request, 'account_security.html', {'account': account, 'fullname': fullname(email), 'name': first_last_initial(email), 'time': settings.SESSION_IDLE_TIMEOUT, 'some_date': dict_act, }) ``` How to write a test case for total function without missing any statement. Please help me out how to write a test case for above function. Thanks ~Salima -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6bnqJs1fgMCUD1FwhzZS3U0aqW0sw1aK4B757viuoM7RbA%40mail.gmail.com.