def create_from_name_and_dictionary(self, name, datas): """Return a populated object Category from dictionary datas """ category = ObjectCategory(name) self.set_common_datas(category, name, datas) if "order" in datas: category.order = int(datas["order"]) return category
def test_category(self): category = Category("a") category.name = "a" category.description = "b" category.order = 2 category_dto = CategoryDto(category) self.assertEqual("a", category_dto.name) self.assertEqual("b", category_dto.description) self.assertEqual(2, category_dto.order)