jarus / flask-testing

Unittest extensions for Flask
http://pythonhosted.org/Flask-Testing/
Other
501 stars 110 forks source link

Fix assertMessageFlashed if no messages were flashed. #96

Closed jcass77 closed 7 years ago

jcass77 commented 8 years ago

Fixes broken test cases for assertMessageFlashed - now checks for exceptions using assertRaises instead of assert False, which would always silently fail in the except block.

Handles case where no messages have been flashed yet by the time that assertMessageFlashed is called.

Fixes #95.

jcass77 commented 8 years ago

I've pushed https://github.com/jarus/flask-testing/pull/96/commits/7ced97e787cdc844abe73bfb422cb3ac8f0642e6 which also fixes a TypeError in the assertTemplateUsed assertion's error message.

jcass77 commented 7 years ago

Any chance of getting this merged? Please let me know if there are any queries.

jcomo commented 7 years ago

Sorry, I've been a bit busy with other things. This looks good, thank you @jcass77! The library was initially developed a few years ago and some of the tools used for unit testing are a bit crude - I'm not surprised this slipped through the cracks. I'm going to make a note of improving the test situation going forward