Theodo-UK / theodo-good-tests

Sharing of testing philosophy and best practices with commonly used examples
40 stars 2 forks source link

Mocking with raised exceptions #25

Open robcronin opened 5 years ago

robcronin commented 5 years ago

@GregGanTheodo

robcronin commented 5 years ago

@TomOConnor95 came across a similar issue with using with self.assertRaises(... and also

self.assertEqual(
            str(err.__dict__["exception"]),
            str(forms.ValidationError(["Custom error"])),
        )