Getting this error while doing unit test for external API
class TestApi(common.TransactionCase):
def setUp(self):
super(TestApi, self).setUp()
self.password = "admin1"
self.user = new_test_user(self.env, login="admin1", password=self.password)
def test_check_associate(self):
params = {
"db": self.env.cr.dbname,
"login": self.user.login,
"password": self.password,
}
url = "http://{}:{}{}".format(HOST, PORT, "/api/auth/token")
response = self.opener.post(url, json=params)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers["Content-Type"], "application/json")
data = response.json()
session = root.session_store.get(data["session"]["sid"])
self.assertEqual(session.login, 'admin')