Fixes test to assert instead of print

This commit fixes a test added as part of #3575, which was done to fix #1713.
Merge pull request #3578 from frutiger/fix_test_for_issue_1713

Fixes test to assert instead of print