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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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.
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
paź 23
|
1181 | ||
|
0
paź 23
|
1972 | ||
|
0
lis 20
|
2937 | ||
|
2
paź 23
|
2532 | ||
|
0
cze 23
|
3583 |