Issue 49588 - Add py3 support for tickets : part-1
Description: Added py3 support by explicitly changing strings to bytes.
Ported tests from ticket to test suites, also added docstrings.
https://pagure.io/389-ds-base/issue/49588
Reviewed by: spichugi,vashirov (Thanks!)