Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5589 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Okt 23
1188
0
Okt 23
1986
0
Nov 20
2942
2
Okt 23
2544
0
Jun 23
3591