diff --git a/common/lib/capa/capa/tests/response_xml_factory.py b/common/lib/capa/capa/tests/response_xml_factory.py index de4c17bae3..af62ef715c 100644 --- a/common/lib/capa/capa/tests/response_xml_factory.py +++ b/common/lib/capa/capa/tests/response_xml_factory.py @@ -102,7 +102,7 @@ class ResponseXMLFactory(six.with_metaclass(ABCMeta, object)): explanation_div.set("class", "detailed-solution") explanation_div.text = explanation_text - return etree.tostring(root) + return etree.tostring(root).decode('utf-8') @staticmethod def textline_input_xml(**kwargs): diff --git a/common/test/acceptance/fixtures/base.py b/common/test/acceptance/fixtures/base.py index a327a3157c..652ae43573 100644 --- a/common/test/acceptance/fixtures/base.py +++ b/common/test/acceptance/fixtures/base.py @@ -166,10 +166,7 @@ class XBlockContainerFixture(StudioApiFixture): """ Encode `post_dict` (a dictionary) as UTF-8 encoded JSON. """ - return json.dumps({ - k: v.encode('utf-8') if isinstance(v, six.string_types) else v - for k, v in post_dict.items() - }) + return json.dumps(post_dict).encode('utf-8') def get_nested_xblocks(self, category=None): """ diff --git a/openedx/core/djangoapps/user_api/accounts/utils.py b/openedx/core/djangoapps/user_api/accounts/utils.py index 1d8b59b7bc..fdc9bf7b0d 100644 --- a/openedx/core/djangoapps/user_api/accounts/utils.py +++ b/openedx/core/djangoapps/user_api/accounts/utils.py @@ -189,7 +189,7 @@ def generate_password(length=12, chars=string.ascii_letters + string.digits): password = '' password += choice(string.digits) - password += choice(string.letters) + password += choice(string.ascii_letters) password += ''.join([choice(chars) for _i in range(length - 2)]) return password