Add test for issue 1704
Merge pull request #2351 from skirpichev/1704-test

Add test for issue 1704