Canonify promiser name before testing if class is set

Also clean up some code; the function now asserts that
excluded is valid, and there is only one caller.

Add uncanonifed promiser to existing test case.

Fixes Redmine #6561
Why is this needed ?  Other than that you've written a test with a dot in a class name, which I think you should not have done ?  Fixing invalid syntax here is wrong; fix the test, so that it has valid class names.