コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
5605 ビュー

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?

アバター
破棄
最善の回答

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.

アバター
破棄
関連投稿 返信 ビュー 活動
0
10月 23
1207
0
10月 23
2030
0
11月 20
2967
2
10月 23
2579
0
6月 23
3605