Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
5615 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
okt. 23
1229
0
okt. 23
2039
0
nov. 20
2974
2
okt. 23
2585
0
jun. 23
3608