I'm writing tests for my Flask project, and are trying to mock my database model. The code looks something like this:
import unittest.mock
@unittest.mock.patch("server.models.user")
def test_that_response_contain_correct_user_data(self, mocked_user):
This results in this error message:
TypeError: test_that_response_contain_correct_user_data() missing 1 required positional argument: 'mocked_user'
So it looks like the mocking framwork doesn't inject the mocked data into the function. Does anyone know what may be causing this?