Merge pull request #21671 from edx/feanil/more_bokchoy_fixes

Feanil/more bokchoy fixes
This commit is contained in:
Feanil Patel
2019-09-16 17:01:09 -04:00
committed by GitHub
3 changed files with 3 additions and 6 deletions

View File

@@ -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):

View File

@@ -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):
"""

View File

@@ -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