Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5598 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ott 23
1195
0
ott 23
2009
0
nov 20
2959
2
ott 23
2571
0
giu 23
3603