Skip to Content
Menu
This question has been flagged
1 Atsakyti
5618 Rodiniai

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?

Portretas
Atmesti
Best Answer

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.

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
spal. 23
1243
0
spal. 23
2046
0
lapkr. 20
2981
2
spal. 23
2595
0
birž. 23
3612