I have a django project running on local development server. It has different remote DB server.
I am trying run API integration tests. Tests are running and giving expected output. Also print statements are generated in console for APIs I am running tests for. But still code coverage is shown 0% for file which was executed after API hit.
This is my sample test function
class Test_Login_User_FR_and_Dispatcher:
BASE_URL = http://passcodev.localhost:8000
FR_LOGIN_ENDPOINT = '/api/user/login/'
# TESTCASE FOR SUCCESSFULL LOGIN OF USER
def test_successfull_login_user(self, success_login):
successfull_login = requests.post(f'{self.BASE_URL}{self.FR_LOGIN_ENDPOINT}',json=success_login)
assert successfull_login.status_code == 200
I am using coverage.py for code coverage report generation.
I tried coverage.py, pytest cov. But still I am unable to find any leads to troubleshoot this problem.