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

I'm writing unit tests for my module and I'd like to do this simple check:

self.assertIs(self.board, wi.board_id)

but I get the aforementioned error. Though, self.assertEqual() works. Is it safe to use assertEqual() for such a test?

Avatar
Opusti
Best Answer

assertEqual(a, b)     a == b     
assertIs(a, b)     a is b

So yes, It is safe use assertEquals. If hoy take a look to Odoo test, equals is used a lot.

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
okt. 23
1191
0
okt. 23
2009
0
nov. 20
2958
2
okt. 23
2570
0
jun. 23
3599