Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2573 Prikazi

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')


Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
maj 24
3186
2
okt. 23
2560
1
apr. 24
26820
1
nov. 22
2625
2
jul. 22
3341