0

I'm creating a Management Command in which I raise a CommandError exception when something goes wrong.

One of my test cases executes the command in a way that it will raise the exception so the result of the test is Error.

How can I make it pass?

Rafael Redrado
  • 493
  • 1
  • 6
  • 19

1 Answers1

1

If your expected behaviour is exception, you can use the assertRaises, look here: https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertRaises

eran
  • 6,731
  • 6
  • 35
  • 52