Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
5550 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
říj 23
1176
0
říj 23
1952
0
lis 20
2928
2
říj 23
2523
0
čvn 23
3562