customer compare in assertEqual

Stone Zhong stone.zhong at gmail.com
Mon Oct 29 20:28:54 EDT 2018


Hi There,

Now I want to make sure my code calls a function foo with an object t, however, foo.assert_called_once_with(t) does not work, since t is a model object and the code may load a different copy of t, so what I really want to test is "It calls foo with t where t.id equals real_t.id, is there a way to do that in python unit test?

Thanks,
Stone



More information about the Python-list mailing list