add unit test for test_RFC-5861
cleanup test thanks to pyflakes mostly