force PuzzleRecipe.db.puzzle_name to be stored as 'str' instead of unicode. Corresponding testcase

This commit is contained in:
Henddher Pedroza 2018-10-13 16:47:06 -05:00
parent cb44de5532
commit 62f94f1cbd
2 changed files with 2 additions and 2 deletions

View file

@ -137,7 +137,7 @@ class PuzzleRecipe(DefaultScript):
"""
def save_recipe(self, puzzle_name, parts, results):
self.db.puzzle_name = puzzle_name
self.db.puzzle_name = str(puzzle_name)
self.db.parts = tuple(parts)
self.db.results = tuple(results)
self.tags.add(_PUZZLES_TAG_RECIPE, category=_PUZZLES_TAG_CATEGORY)

View file

@ -1922,7 +1922,7 @@ class TestPuzzles(CommandTest):
self._use('stone flint', 'There is no stone flint around.')
self._use('stone, flint', 'You have no idea how these can be used')
recipe_dbref = self._good_recipe('makefire', ['stone', 'flint'], ['fire'] , and_destroy_it=False)
recipe_dbref = self._good_recipe(unicode('makefire'), ['stone', 'flint'], ['fire'] , and_destroy_it=False)
recipe2_dbref = self._good_recipe('makefire2', ['stone', 'flint'], ['fire'] , and_destroy_it=False,
expected_count=2)