Skip to Content
Menú
This question has been flagged
1 Respondre
5585 Vistes

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
0
d’oct. 23
1184
0
d’oct. 23
1978
0
de nov. 20
2940
2
d’oct. 23
2540
0
de juny 23
3587