Commit b8b529ad authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[test] updated/refactored test for description widget

parent 4d452a77
...@@ -45,7 +45,9 @@ class MockAssetEditor(AbstractAssetEditor): ...@@ -45,7 +45,9 @@ class MockAssetEditor(AbstractAssetEditor):
super(MockAssetEditor, self).__init__(parent) super(MockAssetEditor, self).__init__(parent)
self.dataformat_model = None self.dataformat_model = None
self.add_field_button = QPushButton(self.tr("Add")) self.add_field_button = QPushButton(self.tr("Add"))
self.description = DescriptionWidget()
layout = QVBoxLayout(self) layout = QVBoxLayout(self)
layout.addWidget(self.description)
layout.addWidget(self.add_field_button) layout.addWidget(self.add_field_button)
self.add_field_button.clicked.connect(self.__add_field) self.add_field_button.clicked.connect(self.__add_field)
...@@ -80,19 +82,12 @@ class MockAssetEditor(AbstractAssetEditor): ...@@ -80,19 +82,12 @@ class MockAssetEditor(AbstractAssetEditor):
def set_description(self, desc): def set_description(self, desc):
"""Sets the text description of the asset""" """Sets the text description of the asset"""
description = DescriptionWidget() self.description.short_description = desc
description.short_description = desc
self.layout().addWidget(description)
def get_description(self): def get_description(self):
"""Returns the text description of the asset""" """Returns the text description of the asset"""
description_list = self.findChildren(DescriptionWidget) text_data = self.description.short_description
text_data = None
description = description_list[0]
text_data = description.short_description
return text_data return text_data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment