1 Feb 2012 02:07
Re: Testing
Russell Keith-Magee <russell <at> keith-magee.com>
2012-02-01 01:07:53 GMT
2012-02-01 01:07:53 GMT
Another option, if you're using unittest2 (and if you're using Django's TestCase, you're using
unittest2) is assertIn --
self.assertIn(first, [one_value, another_value])
Yours,
Russ Magee %-)
On 01/02/2012, at 8:42 AM, Furbee wrote:
> I think you can do something like:
> assertTrue(first == one_value or first == second_value)
>
> At the same time, when unit testing, you should really know exactly what a value returned from a method is.
>
> Furbee
>
> On Tue, Jan 31, 2012 at 4:32 PM, xino12 <xinatowner <at> gmail.com> wrote:
> Hello, I'm doing unitTesting and I want to know if it's possible to
> accept more than one value in the assetEqual method.
>
> Maybe this works
>
> assertEqual(first, one_value or another_value)
>
> Sorry but I'm new programming with django.
>
> Lots of thanks,
>
(Continue reading)
RSS Feed