Fix `test_issue_6973_state_highstate_exit_code`.
Added tests for error template context.
Mimic the test case shown @ http://goo.gl/UI7uS8