14 |
14 |
15 class DjangoTestDataDialog(QDialog, Ui_DjangoTestDataDialog): |
15 class DjangoTestDataDialog(QDialog, Ui_DjangoTestDataDialog): |
16 """ |
16 """ |
17 Class implementing a dialog to enter some data for running tests. |
17 Class implementing a dialog to enter some data for running tests. |
18 """ |
18 """ |
|
19 |
19 def __init__(self, project, keepDatabases, parent=None): |
20 def __init__(self, project, keepDatabases, parent=None): |
20 """ |
21 """ |
21 Constructor |
22 Constructor |
22 |
23 |
23 @param project reference to the Django project object |
24 @param project reference to the Django project object |
24 @type Project |
25 @type Project |
25 @param keepDatabases flag indicating to set the keep databases |
26 @param keepDatabases flag indicating to set the keep databases |
26 check box |
27 check box |
27 @type bool |
28 @type bool |
28 @param parent reference to the parent widget |
29 @param parent reference to the parent widget |
29 @type QWidget |
30 @type QWidget |
30 """ |
31 """ |
31 super().__init__(parent) |
32 super().__init__(parent) |
32 self.setupUi(self) |
33 self.setupUi(self) |
33 |
34 |
34 self.__project = project |
35 self.__project = project |
35 |
36 |
36 self.labelsComboBox.addItems( |
37 self.labelsComboBox.addItems( |
37 self.__project.getRecentTestData("RecentTestLabels")) |
38 self.__project.getRecentTestData("RecentTestLabels") |
38 self.tagsComboBox.addItems( |
39 ) |
39 self.__project.getRecentTestData("RecentTestTags")) |
40 self.tagsComboBox.addItems(self.__project.getRecentTestData("RecentTestTags")) |
40 self.excludeTagsComboBox.addItems( |
41 self.excludeTagsComboBox.addItems( |
41 self.__project.getRecentTestData("RecentTestExcludeTags")) |
42 self.__project.getRecentTestData("RecentTestExcludeTags") |
42 |
43 ) |
|
44 |
43 self.keepCheckBox.setChecked(keepDatabases) |
45 self.keepCheckBox.setChecked(keepDatabases) |
44 |
46 |
45 msh = self.minimumSizeHint() |
47 msh = self.minimumSizeHint() |
46 self.resize(max(self.width(), msh.width()), msh.height()) |
48 self.resize(max(self.width(), msh.width()), msh.height()) |
47 |
49 |
48 def getData(self): |
50 def getData(self): |
49 """ |
51 """ |
50 Public method to get the entered data. |
52 Public method to get the entered data. |
51 |
53 |
52 @return tuple containing a list of test labels, a test file pattern, |
54 @return tuple containing a list of test labels, a test file pattern, |
53 a list of test tags, a list of test tags to be skipped, a flag |
55 a list of test tags, a list of test tags to be skipped, a flag |
54 indicating to keep the test database and a flag indicating to run |
56 indicating to keep the test database and a flag indicating to run |
55 the tests in reverse order |
57 the tests in reverse order |
56 @rtype tuple of |
58 @rtype tuple of |
57 (list of str, str, list of str, list of str, bool, bool) |
59 (list of str, str, list of str, list of str, bool, bool) |
58 """ |
60 """ |
59 labelsStr = self.labelsComboBox.currentText() |
61 labelsStr = self.labelsComboBox.currentText() |
60 self.__project.setMostRecentTestData("RecentTestLabels", labelsStr) |
62 self.__project.setMostRecentTestData("RecentTestLabels", labelsStr) |
61 labels = labelsStr.split() if labelsStr else [] |
63 labels = labelsStr.split() if labelsStr else [] |
62 |
64 |
63 tagsStr = self.tagsComboBox.currentText() |
65 tagsStr = self.tagsComboBox.currentText() |
64 self.__project.setMostRecentTestData("RecentTestTags", tagsStr) |
66 self.__project.setMostRecentTestData("RecentTestTags", tagsStr) |
65 tags = tagsStr.split() if tagsStr else [] |
67 tags = tagsStr.split() if tagsStr else [] |
66 |
68 |
67 excludeTagsStr = self.excludeTagsComboBox.currentText() |
69 excludeTagsStr = self.excludeTagsComboBox.currentText() |
68 self.__project.setMostRecentTestData("RecentTestExcludeTags", |
70 self.__project.setMostRecentTestData("RecentTestExcludeTags", excludeTagsStr) |
69 excludeTagsStr) |
|
70 excludeTags = excludeTagsStr.split() if excludeTagsStr else [] |
71 excludeTags = excludeTagsStr.split() if excludeTagsStr else [] |
71 |
72 |
72 return ( |
73 return ( |
73 labels, |
74 labels, |
74 self.testFilePatternsEdit.text(), |
75 self.testFilePatternsEdit.text(), |
75 tags, |
76 tags, |
76 excludeTags, |
77 excludeTags, |