Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5693 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
1305
0
Okt 23
2145
0
Nov 20
3058
2
Okt 23
2673
0
Jun 23
3692